-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Fix SyntaxWarning messages from python 3.12 #86806
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM, verified the two strings are the same
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But automatic replacement is not possible, because |
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.
I see lots of changes to comment blocks in this patch. Can we use
'''instead to fix those warnings?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.
No,

'''\-'''is still SyntaxWarning in Python 3.12. It is possible to not escape with raw literals, but raw literals are used mostly to indicate that string is actually raw (I've never seen raw docblocks). Also there is some consensus between highlighting tools that raw literals use regexp highlighting (in vscode, dandavison/delta, sharkdp/bat), that's why I escaped some strings selectively (e. g. in runCmd I did not use raw literals).