summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_marshal.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-05-26 21:41:42 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-05-26 21:41:42 (GMT)
commit74c71f5a624cef653c7da470607ca063b749ef75 (patch)
tree9f12198761e274b73716ee6c59be788fd9ecc628 /Lib/test/test_marshal.py
parent954aa943f13f183289392d9888cd83cc67715a68 (diff)
downloadcpython-74c71f5a624cef653c7da470607ca063b749ef75.zip
cpython-74c71f5a624cef653c7da470607ca063b749ef75.tar.gz
cpython-74c71f5a624cef653c7da470607ca063b749ef75.tar.bz2
#2957: marshal recursion limit exceeded when importing a large .pyc file
Diffstat (limited to 'Lib/test/test_marshal.py')
-rw-r--r--Lib/test/test_marshal.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 83ab852..6e3efe4 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -113,6 +113,12 @@ class CodeTestCase(unittest.TestCase):
new = marshal.loads(marshal.dumps(co))
self.assertEqual(co, new)
+ def test_many_codeobjects(self):
+ # Issue2957: bad recursion count on code objects
+ count = 5000 # more than MAX_MARSHAL_STACK_DEPTH
+ codes = (ExceptionTestCase.test_exceptions.__code__,) * count
+ marshal.loads(marshal.dumps(codes))
+
class ContainerTestCase(unittest.TestCase, HelperMixin):
d = {'astring': 'foo@bar.baz.spam',
'afloat': 7283.43,