Skip to content
Snippets Groups Projects
Commit a8225b0e authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

let setrlimit fail :/

parent cc70a9cd
No related branches found
No related tags found
Loading
...@@ -36,7 +36,12 @@ def less_limited_stack(): ...@@ -36,7 +36,12 @@ def less_limited_stack():
More precisely, the soft stack limit is raised to the hard limit. More precisely, the soft stack limit is raised to the hard limit.
""" """
soft, hard = getrlimit(RLIMIT_STACK) soft, hard = getrlimit(RLIMIT_STACK)
# We can raise the soft limit to the hard limit and no higher. try:
setrlimit(RLIMIT_STACK, (hard, hard)) # We can raise the soft limit to the hard limit and no higher.
yield setrlimit(RLIMIT_STACK, (hard, hard))
setrlimit(RLIMIT_STACK, (soft, hard)) except ValueError:
# Well, not on macOS: https://bugs.python.org/issue34602
yield
else:
yield
setrlimit(RLIMIT_STACK, (soft, hard))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment