[pypy-svn] r72613 - pypy/branch/cpython-extension/pypy/module/cpyext

xoraxax at codespeak.net xoraxax at codespeak.net
Tue Mar 23 11:53:34 CET 2010


Author: xoraxax
Date: Tue Mar 23 11:53:33 2010
New Revision: 72613

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/methodobject.py
Log:
Fix kwargs handling of generic_cpy_call, set acceptable_as_base_class correctly.

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/methodobject.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/methodobject.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/methodobject.py	Tue Mar 23 11:53:33 2010
@@ -29,8 +29,8 @@
     return ret
 
 def generic_cpy_call(space, func, *args, **kwargs):
-    decref_args = kwargs.pop("decref_args", False)
-    assert not decref_args
+    decref_args = kwargs.pop("decref_args", True)
+    assert not kwargs
     boxed_args = []
     for arg in args: # XXX ur needed
         if isinstance(arg, W_Root) or arg is None:
@@ -52,7 +52,6 @@
 
 # XXX use Function as a parent class?
 class W_PyCFunctionObject(Wrappable):
-    acceptable_as_base_class = False
     def __init__(self, space, ml, w_self):
         self.space = space
         self.ml = ml
@@ -114,6 +113,8 @@
     __call__ = interp2app(cfunction_descr_call),
     )
 
+W_PyCFunctionObject.typedef.acceptable_as_base_class = False
+
 W_PyCMethodObject.typedef = TypeDef(
     'method',
     __get__ = interp2app(cmethod_descr_get),
@@ -123,6 +124,7 @@
     __repr__ = interp2app(W_PyCMethodObject.descr_method_repr),
     )
 
+W_PyCMethodObject.typedef.acceptable_as_base_class = False
 
 def PyCFunction_NewEx(space, ml, w_self): # not directly the API sig
     return space.wrap(W_PyCFunctionObject(space, ml, w_self))



More information about the Pypy-commit mailing list