Skip to content

Instantly share code, notes, and snippets.

@rlamy
Created March 19, 2020 18:25
Show Gist options
  • Save rlamy/8da5c9b0425d495f52c7f25e0ebd5f18 to your computer and use it in GitHub Desktop.
Save rlamy/8da5c9b0425d495f52c7f25e0ebd5f18 to your computer and use it in GitHub Desktop.
RecursionError mess on pypy3
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