Author: Brian Kearns <bdkea...@gmail.com> Branch: fix-tpname Changeset: r71206:af335604eacc Date: 2014-05-02 17:19 -0400 http://bitbucket.org/pypy/pypy/changeset/af335604eacc/
Log: fix translation 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 @@ -6,6 +6,7 @@ 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, @@ -158,7 +159,9 @@ 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: diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py --- a/pypy/module/cpyext/typeobject.py +++ b/pypy/module/cpyext/typeobject.py @@ -513,7 +513,7 @@ 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: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit