Commit 991bf5d8 authored by Guido van Rossum's avatar Guido van Rossum

Patch # 1050 by Amaury Forgeot d'Arc.

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.
parent cf3c4217
......@@ -169,6 +169,9 @@ class BugsTestCase(unittest.TestCase):
# Create a deeply nested structure.
head = last = []
# The max stack depth should match the value in Python/marshal.c.
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])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment