Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r54642:73a34fe1ff67 Date: 2012-04-23 08:53 +0200 http://bitbucket.org/pypy/pypy/changeset/73a34fe1ff67/
Log: Fixes: * cannot do bool(res) if res is an INT on 32-bit * a return value of -1 doesn't necessarily mean we have an exception 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 @@ -65,8 +65,9 @@ check_num_args(space, w_args, 0) args_w = space.fixedview(w_args) res = generic_cpy_call(space, func_inquiry, w_self) - if rffi.cast(lltype.Signed, res) == -1: - space.fromcache(State).check_and_raise_exception(always=True) + res = rffi.cast(lltype.Signed, res) + if res == -1: + space.fromcache(State).check_and_raise_exception() return space.wrap(bool(res)) def wrap_getattr(space, w_self, w_args, func): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit