[pypy-commit] pypy cpyext-avoid-roundtrip: bah, the flags attribute was not set because this class didn't call the parent __init__; fix

antocuni pypy.commits at gmail.com
Sun Oct 22 11:50:16 EDT 2017


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: cpyext-avoid-roundtrip
Changeset: r92828:85dbd5c26f1d
Date: 2017-10-22 17:49 +0200
http://bitbucket.org/pypy/pypy/changeset/85dbd5c26f1d/

Log:	bah, the flags attribute was not set because this class didn't call
	the parent __init__; fix

diff --git a/pypy/module/cpyext/methodobject.py b/pypy/module/cpyext/methodobject.py
--- a/pypy/module/cpyext/methodobject.py
+++ b/pypy/module/cpyext/methodobject.py
@@ -139,11 +139,10 @@
             return space.w_None
 
 class W_PyCMethodObject(W_PyCFunctionObject):
-    w_self = None
+
     def __init__(self, space, ml, w_type):
+        W_PyCFunctionObject.__init__(self, space, ml, w_self=None)
         self.space = space
-        self.ml = ml
-        self.name = rffi.charp2str(rffi.cast(rffi.CCHARP, ml.c_ml_name))
         self.w_objclass = w_type
 
     def __repr__(self):


More information about the pypy-commit mailing list