8000 gh-98401: Invalid escape sequences emits SyntaxWarning by vstinner · Pull Request #99011 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-98401: Invalid escape sequences emits SyntaxWarning #99011

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

Merged
merged 2 commits into from
Nov 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix test_string_literals
  • Loading branch information
vstinner committed Nov 3, 2022
commit d24f799d286324511ef820f0d236cee74152e266
4 changes: 2 additions & 2 deletions Lib/test/test_string_literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_eval_str_invalid_octal_escape(self):
self.assertEqual(eval(r"'\%o'" % i), chr(i))

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always', category=DeprecationWarning)
warnings.simplefilter('always', category=SyntaxWarning)
eval("'''\n\\407'''")
self.assertEqual(len(w), 1)
self.assertEqual(str(w[0].message),
Expand Down Expand Up @@ -213,7 +213,7 @@ def test_eval_bytes_invalid_octal_escape(self):
self.assertEqual(eval(r"b'\%o'" % i), bytes([i & 0o377]))

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always', category=DeprecationWarning)
warnings.simplefilter('always', category=SyntaxWarning)
eval("b'''\n\\407'''")
self.assertEqual(len(w), 1)
self.assertEqual(str(w[0].message),
Expand Down
0