From 28d05eae2dd7f549f68ecf3482b639a9a7dfc12e Mon Sep 17 00:00:00 2001 From: Lysandros Nikolaou Date: Fri, 13 Oct 2023 09:41:00 +0200 Subject: [PATCH 1/2] gh-107450: Fix parser column offset overflow test on Windows (GH-110768) (cherry picked from commit 05439d308740b621d03562451a7608eb725937ae) Co-authored-by: Lysandros Nikolaou Co-authored-by: Nikita Sobolev --- Lib/test/test_exceptions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 5d460982ddfa48..5ca5bc9d3662d7 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -318,8 +318,10 @@ def baz(): check('(yield i) = 2', 1, 2) check('def f(*):\n pass', 1, 7) + @support.requires_resource('cpu') + @support.bigmemtest(support._2G, memuse=1.5) def testMemoryErrorBigSource(self): - with self.assertRaisesRegex(OverflowError, "column offset overflow"): + with self.assertRaises(OverflowError): exec(f"if True:\n {' ' * 2**31}print('hello world')") @cpython_only From b2273a3618b0cabeb2f3fbda1c82899eee706a07 Mon Sep 17 00:00:00 2001 From: Lysandros Nikolaou Date: Fri, 13 Oct 2023 10:04:01 +0200 Subject: [PATCH 2/2] Fix test --- Lib/test/test_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 5ca5bc9d3662d7..9de7e7355e5742 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -320,7 +320,7 @@ def baz(): @support.requires_resource('cpu') @support.bigmemtest(support._2G, memuse=1.5) - def testMemoryErrorBigSource(self): + def testMemoryErrorBigSource(self, _size): with self.assertRaises(OverflowError): exec(f"if True:\n {' ' * 2**31}print('hello world')")