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

wrapper: use raw string literals for regular expressions #946

Merged
merged 1 commit into from
May 23, 2024

Conversation

jkhsjdhjs
Copy link
Contributor

This fixes a SyntaxWarning with Python 3.12:

/usr/lib/nzbhydra2/nzbhydra2wrapperPy3.py:584: SyntaxWarning: invalid escape sequence '\d'
  match = re.match('(java|openjdk) (version )?"?(?P<major>\d+)((\.(?P<minor>\d+)\.(?P<patch>\d)+)?[\-_\w]*)?"?.*', versionLine)

Although Python 2 doesn't print a warning, using a raw string literal is the correct thing to do, so I applied this change to the Python 2 wrapper as well.

This fixes a SyntaxWarning with Python 3.12:

/usr/lib/nzbhydra2/nzbhydra2wrapperPy3.py:584: SyntaxWarning: invalid escape sequence '\d'
  match = re.match('(java|openjdk) (version )?"?(?P<major>\d+)((\.(?P<minor>\d+)\.(?P<patch>\d)+)?[\-_\w]*)?"?.*', versionLine)

Although Python 2 doesn't print a warning, using a raw string literal is
the correct thing to do, so I applied this change to the Python 2
wrapper as well.
@theotherp theotherp merged commit fbddaf2 into theotherp:master May 23, 2024
1 check passed
@theotherp
Copy link
Owner

Thanks!

theotherp added a commit that referenced this pull request May 23, 2024
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.

None yet

2 participants