mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-34683: Make SyntaxError column offsets consistently 1-indexed (gh-9338)
Also point to start of tokens in parsing errors. Fixes bpo-34683
This commit is contained in:
parent
223e501fb9
commit
025eb98dc0
11 changed files with 65 additions and 21 deletions
|
@ -169,7 +169,7 @@ class SymtableTest(unittest.TestCase):
|
|||
else:
|
||||
self.fail("no SyntaxError for %r" % (brokencode,))
|
||||
checkfilename("def f(x): foo)(", 14) # parse-time
|
||||
checkfilename("def f(x): global x", 10) # symtable-build-time
|
||||
checkfilename("def f(x): global x", 11) # symtable-build-time
|
||||
symtable.symtable("pass", b"spam", "exec")
|
||||
with self.assertWarns(DeprecationWarning), \
|
||||
self.assertRaises(TypeError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue