[pypy-commit] pypy default: Uh? Don't use _example() here. If the callback returns a pointer

arigo noreply at buildbot.pypy.org
Thu Jun 9 10:20:56 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r44848:476ab5c0b538
Date: 2011-06-09 10:22 +0200
http://bitbucket.org/pypy/pypy/changeset/476ab5c0b538/

Log:	Uh? Don't use _example() here. If the callback returns a pointer
	to S, it will make a dummy S and return a pointer to it in case of
	error, which sounds strange (and broken, in case S is actually an
	opaque).

diff --git a/pypy/rpython/lltypesystem/rffi.py b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -253,7 +253,7 @@
     if hasattr(callable, '_errorcode_'):
         errorcode = callable._errorcode_
     else:
-        errorcode = TP.TO.RESULT._example()
+        errorcode = TP.TO.RESULT._defl()
     callable_name = getattr(callable, '__name__', '?')
     if callbackholder is not None:
         callbackholder.callbacks[callable] = True


More information about the pypy-commit mailing list