[pypy-commit] pypy default: Fixes:

arigo noreply at buildbot.pypy.org
Mon Apr 23 08:53:53 CEST 2012


Author: Armin Rigo <arigo at 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):


More information about the pypy-commit mailing list