diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2023-10-12 09:34:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-12 09:34:12 (GMT) |
commit | fb7843ee895ac7f6eeb58f356b1a320eea081cfc (patch) | |
tree | 2bfacf2b0e36e0d4bd4ecc00acde803ce17a9c45 /Lib/test | |
parent | 3d180347ae73119bb51500efeeafdcd62bcc6f78 (diff) | |
download | cpython-fb7843ee895ac7f6eeb58f356b1a320eea081cfc.zip cpython-fb7843ee895ac7f6eeb58f356b1a320eea081cfc.tar.gz cpython-fb7843ee895ac7f6eeb58f356b1a320eea081cfc.tar.bz2 |
gh-107450: Raise OverflowError when parser column offset overflows (#110754)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_exceptions.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 05a89e7..bba2eeb 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -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 |