bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652)

for invalid escape sequences in string and bytes literals.
This commit is contained in:
Serhiy Storchaka 2018-10-19 17:42:06 +03:00 committed by GitHub
parent 209144831b
commit 6543912c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 12 deletions

View file

@ -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')