Author: Matti Picus <matti.pi...@gmail.com>
Branch: py3.6
Changeset: r96144:363f2ef2fd93
Date: 2019-02-24 13:51 +0200
http://bitbucket.org/pypy/pypy/changeset/363f2ef2fd93/

Log:    merge default into branch

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
@@ -154,7 +154,7 @@
                    dealloc=descr_dealloc,
                    )
 
-def init_descr(space, py_obj, w_type, c_name):
+def init_descr(space, py_obj, w_type, name):
     """Initialises the common fields in a PyDescrObject
 
     Arguments:
@@ -162,12 +162,10 @@
         w_type: W_TypeObject
         c_name: char*
     """
-    from pypy.module.cpyext.unicodeobject import PyUnicode_FromString
     py_descr = cts.cast('PyDescrObject*', py_obj)
     py_descr.c_d_type = cts.cast(
         'PyTypeObject*', make_ref(space, w_type))
-    py_descr.c_d_name = make_ref(
-        space, PyUnicode_FromString(space, c_name))
+    py_descr.c_d_name = make_ref(space, space.newtext(name))
 
 @slot_function([PyObject], lltype.Void)
 def descr_dealloc(space, py_obj):
@@ -185,7 +183,7 @@
     py_memberdescr = cts.cast('PyMemberDescrObject*', py_obj)
     assert isinstance(w_obj, W_MemberDescr)
     py_memberdescr.c_d_member = w_obj.member
-    init_descr(space, py_obj, w_obj.w_type, w_obj.member.c_name)
+    init_descr(space, py_obj, w_obj.w_type, w_obj.name)
 
 def memberdescr_realize(space, obj):
     # XXX NOT TESTED When is this ever called?
@@ -210,13 +208,13 @@
         # XXX how is this ever released?
     assert isinstance(w_obj, W_GetSetPropertyEx)
     py_getsetdescr.c_d_getset = w_obj.getset
-    init_descr(space, py_obj, w_obj.w_type, w_obj.getset.c_name)
+    init_descr(space, py_obj, w_obj.w_type, w_obj.name)
 
 def methoddescr_attach(space, py_obj, w_obj, w_userdata=None):
     py_methoddescr = cts.cast('PyMethodDescrObject*', py_obj)
     assert isinstance(w_obj, W_PyCFunctionObject)
     py_methoddescr.c_d_method = w_obj.ml
-    init_descr(space, py_obj, w_obj.w_objclass, w_obj.ml.c_ml_name)
+    init_descr(space, py_obj, w_obj.w_objclass, w_obj.name)
 
 def classmethoddescr_realize(space, obj):
     # XXX NOT TESTED When is this ever called?
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to