Commits

Brian Kearns committed af33560

fix translation

Comments (0)

Files changed (2)

pypy/module/cpyext/methodobject.py

 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.typedef import (
     GetSetProperty, TypeDef, interp_attrproperty, interp_attrproperty_w)
+from pypy.objspace.std.typeobject import W_TypeObject
 from pypy.module.cpyext.api import (
     CONST_STRING, METH_CLASS, METH_COEXIST, METH_KEYWORDS, METH_NOARGS, METH_O,
     METH_STATIC, METH_VARARGS, PyObject, PyObjectFields, bootstrap_function,
         self.doc = doc
         self.func = func
         pyo = rffi.cast(PyObject, pto)
-        self.w_objclass = from_ref(space, pyo)
+        w_type = from_ref(space, pyo)
+        assert isinstance(w_type, W_TypeObject)
+        self.w_objclass = w_type
 
     def call(self, space, w_self, w_args, w_kw):
         if self.wrapper_func is None:

pypy/module/cpyext/typeobject.py

         from pypy.module.cpyext.stringobject import PyString_AsString
         pto.c_tp_name = PyString_AsString(space, heaptype.c_ht_name)
     else:
-        pto.c_tp_name = rffi.str2charp(w_type.getname(space))
+        pto.c_tp_name = rffi.str2charp(w_type.name)
     pto.c_tp_basicsize = -1 # hopefully this makes malloc bail out
     pto.c_tp_itemsize = 0
     # uninitialized fields: