[pypy-svn] r72972 - pypy/branch/cpython-extension/pypy/module/cpyext
xoraxax at codespeak.net
xoraxax at codespeak.net
Sat Mar 27 20:46:21 CET 2010
Author: xoraxax
Date: Sat Mar 27 20:46:19 2010
New Revision: 72972
Modified:
pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py
Log:
Output error message if a wrapper function is missing and we cannot fill the typeobject correctly because of it.
Modified: pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py (original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/typeobject.py Sat Mar 27 20:46:19 2010
@@ -63,7 +63,7 @@
# XXX support PyObject_HashNotImplemented
state = space.fromcache(State)
for method_name, slot_name, _, wrapper_func, wrapper_func_kwds, doc in state.slotdefs: # XXX use UI
- if method_name in dict_w or (wrapper_func is None and wrapper_func_kwds is None):
+ if method_name in dict_w:
continue
# XXX is this rpython?
if len(slot_name) == 1:
@@ -77,6 +77,9 @@
func_voidp = rffi.cast(rffi.VOIDP_real, func)
if not func:
continue
+ if wrapper_func is None and wrapper_func_kwds is None:
+ print >>sys.stderr, method_name, "used by the type but no wrapper function defined!"
+ continue
dict_w[method_name] = PyDescr_NewWrapper(space, pto, method_name, wrapper_func,
wrapper_func_kwds, doc, func_voidp)
More information about the Pypy-commit
mailing list