Author: Ronan Lamy <ronan.l...@gmail.com> Branch: py3.5 Changeset: r91786:28fa40558660 Date: 2017-07-07 15:18 +0100 http://bitbucket.org/pypy/pypy/changeset/28fa40558660/
Log: Py_EnterRecursiveCall now raises RecursionError instead of generic RuntimeError (changed in 3.5) diff --git a/pypy/module/cpyext/eval.py b/pypy/module/cpyext/eval.py --- a/pypy/module/cpyext/eval.py +++ b/pypy/module/cpyext/eval.py @@ -261,12 +261,12 @@ global limit limit += 1 if limit > 10: - raise oefmt(space.w_RuntimeError, + raise oefmt(space.w_RecursionError, "maximum recursion depth exceeded%s", rffi.charp2str(where)) return 0 from rpython.rlib.rstack import stack_almost_full if stack_almost_full(): - raise oefmt(space.w_RuntimeError, + raise oefmt(space.w_RecursionError, "maximum recursion depth exceeded%s", rffi.charp2str(where)) return 0 diff --git a/pypy/module/cpyext/test/test_eval.py b/pypy/module/cpyext/test/test_eval.py --- a/pypy/module/cpyext/test/test_eval.py +++ b/pypy/module/cpyext/test/test_eval.py @@ -360,9 +360,5 @@ return PyLong_FromLong(res); """),], prologue= ''' int recurse(void); ''' ) - try: - res = module.call_recursive() - except RuntimeError as e: - assert 'while calling recurse' in str(e) - else: - assert False, "expected RuntimeError" + excinfo = raises(RecursionError, module.call_recursive) + assert 'while calling recurse' in str(excinfo.value) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit