Author: Ronan Lamy <ronan.l...@gmail.com> Branch: Changeset: r90312:ba83efb4837f Date: 2017-02-22 18:51 +0000 http://bitbucket.org/pypy/pypy/changeset/ba83efb4837f/
Log: Check for errors raised in sq_length diff --git a/pypy/module/cpyext/slotdefs.py b/pypy/module/cpyext/slotdefs.py --- a/pypy/module/cpyext/slotdefs.py +++ b/pypy/module/cpyext/slotdefs.py @@ -237,7 +237,10 @@ def wrap_lenfunc(space, w_self, w_args, func): func_len = rffi.cast(lenfunc, func) check_num_args(space, w_args, 0) - return space.newint(generic_cpy_call(space, func_len, w_self)) + res = generic_cpy_call(space, func_len, w_self) + if widen(res) == -1: + space.fromcache(State).check_and_raise_exception(always=True) + return space.newint(res) def wrap_sq_item(space, w_self, w_args, func): func_target = rffi.cast(ssizeargfunc, func) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit