Skip to content

Commit

Permalink
Fix invalid escape sequence in utils, minor cleanup in python script (v…
Browse files Browse the repository at this point in the history
…alkey-io#948)

According to the Python document[1], any invalid escape sequences in
string literals now generate a DeprecationWarning (SyntaxWarning as of
3.12) and in the future this will become a SyntaxError.

This Change uses Python’s raw string notation for regular expression
patterns to avoid it.

[1]: https://docs.python.org/3.10/library/re.html

Signed-off-by: haoqixu <hq.xu0o0@gmail.com>
  • Loading branch information
haoqixu authored Aug 26, 2024
1 parent 9f4b1ad commit 73698fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/generate-unit-test-header.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

UNIT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + '/../src/unit')
TEST_FILE = UNIT_DIR + '/test_files.h'
TEST_PROTOTYPE = '(int (test_[a-zA-Z0-9_]*)\(.*\)).*{'
TEST_PROTOTYPE = r'(int (test_[a-zA-Z0-9_]*)\(.*\)).*{'

if __name__ == '__main__':
with open(TEST_FILE, 'w') as output:
Expand Down

0 comments on commit 73698fa

Please sign in to comment.