-
-
Save rlamy/8da5c9b0425d495f52c7f25e0ebd5f18 to your computer and use it in GitHub Desktop.
RecursionError mess on pypy3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def f(): | |
try: | |
return f() | |
except RecursionError: | |
return sys.exc_info() | |
def do_check(): | |
f() | |
assert sys.exc_info() == (None, None, None) | |
def recurse(n): | |
print(n) | |
if n <= 0: | |
return do_check() | |
else: | |
return recurse(n-1) | |
def test_recursion(): | |
for i in range(50): | |
recurse(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment