Mark Dickinson added the comment: > I think the issue arises when the AST is built.
It's occurring when generating a code object from the AST, after the AST is built: Python 3.3.0+ (3.3:bf1bf3bf3fe2, Nov 22 2012, 10:45:24) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> code = "el".join(['if False: pass\n']*10000) >>> import ast >>> tree = ast.parse(code) >>> code_obj = compile(tree, 'noname.py', 'exec') Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: maximum recursion depth exceeded during compilation I don't know why you're getting a segfault rather than the above RuntimeError, though: on my machine this goes straight from working to the RuntimeError: >>> code = "el".join(['if False: pass\n']*2996) >>> code_obj = compile(ast.parse(code), 'noname.py', 'exec') >>> code = "el".join(['if False: pass\n']*2997) >>> code_obj = compile(ast.parse(code), 'noname.py', 'exec') Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: maximum recursion depth exceeded during compilation Crys: do you still see the segfault if COMPILER_STACK_FRAME_SCALE is #define'd to be 2 rather than 3? ---------- nosy: +mark.dickinson _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16527> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com