]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch # 1050 by Amaury Forgeot d'Arc.
authorGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 18:44:54 +0000 (18:44 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 18:44:54 +0000 (18:44 +0000)
On Windows, debug builds insert stack probes, and recursive functions
tend to exhaust the stack faster.
This patch reduces the marshal maximum depth from 2000 to 1500 for debug
builds only. Optimized builds are not affected.
This allows test_marshal to pass with debug builds.

Lib/test/test_marshal.py

index 6efa4160a0852302cb312ab0a6fb4c7458af9bee..47e610f4f2fac829eea8c38f3dfea5ea47933431 100644 (file)
@@ -169,7 +169,10 @@ class BugsTestCase(unittest.TestCase):
         # Create a deeply nested structure.
         head = last = []
         # The max stack depth should match the value in Python/marshal.c.
-        MAX_MARSHAL_STACK_DEPTH = 2000
+        if os.name == 'nt' and hasattr(sys, 'gettotalrefcount'):
+            MAX_MARSHAL_STACK_DEPTH = 1500
+        else:
+            MAX_MARSHAL_STACK_DEPTH = 2000
         for i in range(MAX_MARSHAL_STACK_DEPTH - 2):
             last.append([0])
             last = last[-1]