aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>2021-10-28 06:11:18 -0400
committerGitHub <noreply@github.com>2021-10-28 11:11:18 +0100
commitd56375a0dd4cee162081b173310298a3d32af293 (patch)
tree5d9ecb5cff63e670aa40e4c0f1cbe655dc7dedad /Lib/test/pickletester.py
parent4c95fb4640c0247903562dae4478158b348cea6d (diff)
downloadcpython-d56375a0dd4cee162081b173310298a3d32af293.tar.gz
cpython-d56375a0dd4cee162081b173310298a3d32af293.zip
bpo-30570: Fix segfault on buildbots caused by stack overflow from recursion in tests (GH-29258)
* Don't stackoveflow on debug builds * Also catch the pickletester case
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 3e2c781caa1..f13d42f6648 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -2383,7 +2383,8 @@ class AbstractPickleTests:
# Issue #3514: crash when there is an infinite loop in __getattr__
x = BadGetattr()
for proto in protocols:
- self.assertRaises(RuntimeError, self.dumps, x, proto)
+ with support.infinite_recursion():
+ self.assertRaises(RuntimeError, self.dumps, x, proto)
def test_reduce_bad_iterator(self):
# Issue4176: crash when 4th and 5th items of __reduce__()