mirror of
https://github.com/python/cpython.git
synced 2025-07-31 23:23:11 +00:00
SF patch# 1755885 by Kurt Kaiser: show location of Unicode escape errors.
(Slightly tweaked for style and refcounts.)
This commit is contained in:
parent
a3a4c2f411
commit
b6ac23cd07
2 changed files with 25 additions and 2 deletions
|
@ -474,6 +474,12 @@ class CompileTestCase(unittest.TestCase):
|
|||
st = parser.suite('1 = 3 + 4')
|
||||
self.assertRaises(SyntaxError, parser.compilest, st)
|
||||
|
||||
def test_compile_badunicode(self):
|
||||
st = parser.suite('a = u"\U12345678"')
|
||||
self.assertRaises(SyntaxError, parser.compilest, st)
|
||||
st = parser.suite('a = u"\u1"')
|
||||
self.assertRaises(SyntaxError, parser.compilest, st)
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(
|
||||
RoundtripLegalSyntaxTestCase,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue