mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue 28128: Print out better error/warning messages for invalid string escapes. Backport to 3.6.
This commit is contained in:
parent
7f0514ad54
commit
5646648678
8 changed files with 173 additions and 22 deletions
|
|
@ -2413,13 +2413,6 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
support.check_free_after_iterating(self, iter, str)
|
||||
support.check_free_after_iterating(self, reversed, str)
|
||||
|
||||
def test_invalid_sequences(self):
|
||||
for letter in string.ascii_letters + "89": # 0-7 are octal escapes
|
||||
if letter in "abfnrtuvxNU":
|
||||
continue
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
eval(r"'\%s'" % letter)
|
||||
|
||||
|
||||
class CAPITest(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue