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
Marked regexp patterns as raw strings and bytes to address the invalid escape warning on Python 3.6+ #1057
Conversation
…d escape warning on Python 3.6+
Hello. Invalid because the have just one slash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
@@ -1690,7 +1690,7 @@ def num_ctx_switches(self, _ctxsw_re=re.compile(b'ctxt_switches:\t(\d+)')): | |||
return _common.pctxsw(int(ctxsw[0]), int(ctxsw[1])) | |||
|
|||
@wrap_exceptions | |||
def num_threads(self, _num_threads_re=re.compile(b'Threads:\t(\d+)')): | |||
def num_threads(self, _num_threads_re=re.compile(br'hreads:\t(\d+)')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is now missing the initial T
How do you see the warnings? I tried |
Also tried |
Oh, I see, I was supposed to clean all pyc files first. LGTM except #1057 (comment) |
Awesome guys! Thank you for being so fast and thorough with the review. |
Starting with 3.6.0, invalid escapes in string and byte literals trigger a DepreacationWarning. This diff marks regexp patterns where such escapes occur as "raw". There are probably other occurrences for non-Linux platforms, but since I can't test chances for such platforms I elected to not to make the changes.