mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-107450: Raise OverflowError when parser column offset overflows (#110754)
This commit is contained in:
parent
3d180347ae
commit
fb7843ee89
2 changed files with 10 additions and 0 deletions
|
@ -318,6 +318,10 @@ class ExceptionTests(unittest.TestCase):
|
|||
check('(yield i) = 2', 1, 2)
|
||||
check('def f(*):\n pass', 1, 7)
|
||||
|
||||
def testMemoryErrorBigSource(self):
|
||||
with self.assertRaisesRegex(OverflowError, "column offset overflow"):
|
||||
exec(f"if True:\n {' ' * 2**31}print('hello world')")
|
||||
|
||||
@cpython_only
|
||||
def testSettingException(self):
|
||||
# test that setting an exception at the C level works even if the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue