mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652)
for invalid escape sequences in string and bytes literals.
This commit is contained in:
parent
209144831b
commit
6543912c90
6 changed files with 23 additions and 12 deletions
|
@ -626,7 +626,7 @@ non-important content
|
|||
self.assertEqual(f'2\x203', '2 3')
|
||||
self.assertEqual(f'\x203', ' 3')
|
||||
|
||||
with self.assertWarns(DeprecationWarning): # invalid escape sequence
|
||||
with self.assertWarns(SyntaxWarning): # invalid escape sequence
|
||||
value = eval(r"f'\{6*7}'")
|
||||
self.assertEqual(value, '\\42')
|
||||
self.assertEqual(f'\\{6*7}', '\\42')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue