Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "SyntaxWarning: invalid escape sequence" warnings #31

Merged
merged 2 commits into from
May 12, 2024

Conversation

jiripospisil
Copy link
Contributor

Hello, fixed a few warnings emitted when using Python 3.12.

From: https://docs.python.org/3.14/whatsnew/3.12.html#other-language-changes

A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence, use raw strings for regular expression: re.compile(r"\d+.\d+")). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)

$ python --version
Python 3.12.3
$ python -m compileall -f -q .
./marcel/doc/help_color.py:16: SyntaxWarning: invalid escape sequence '\{'
  HELP = '''
./marcel/doc/help_operator.py:16: SyntaxWarning: invalid escape sequence '\{'
  HELP = '''
./test/test_ops.py:271: SyntaxWarning: invalid escape sequence '\|'
  TEST.run('gen 75 | select (x: x in (18, 36, 73)) | red \|',

Copy link
Owner

@geophile geophile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you.

@geophile
Copy link
Owner

Could you please bump the minor version to go along with this change? It's in marcel/marcel/version.py.

@jiripospisil
Copy link
Contributor Author

Could you please bump the minor version to go along with this change? It's in marcel/marcel/version.py.

Done.

@geophile geophile merged commit 10e861d into geophile:master May 12, 2024
@jiripospisil jiripospisil deleted the invalid-escape-sequence branch May 12, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants