Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,13 @@ def test_recursion_limit(self):
# for threads
script = """if True:
import threading
# TODO: RUSTPYTHON
# Following lines set the recursion limit to previous default of 512
# for the execution of this process. Without this, the test runners
# on Github fail. Ideally, at a future point this should be removed.
import os, sys
if os.getenv("CI"):
sys.setrecursionlimit(512)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I was setting it at the wrong place before since I didn't notice a new process is being spawned here. By modifying the
recursion limit inside the script that's executed, it seems to handle things just fine.


def recurse():
return recurse()
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl VirtualMachine {
profile_func,
trace_func,
use_tracing: Cell::new(false),
recursion_limit: Cell::new(if cfg!(debug_assertions) { 256 } else { 512 }),
recursion_limit: Cell::new(if cfg!(debug_assertions) { 256 } else { 1000 }),
signal_handlers: Some(Box::new(signal_handlers)),
repr_guards: RefCell::default(),
state: PyRc::new(PyGlobalState {
Expand Down