[pypy-commit] pypy unicode-utf8-py3: w_type.getname returns utf8

mattip pypy.commits at gmail.com
Sun Aug 5 14:13:22 EDT 2018


Author: Matti Picus <matti.picus at gmail.com>
Branch: unicode-utf8-py3
Changeset: r94949:da2e74e209e0
Date: 2018-08-05 10:34 -0700
http://bitbucket.org/pypy/pypy/changeset/da2e74e209e0/

Log:	w_type.getname returns utf8

diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -148,7 +148,7 @@
         except OperationError as e:
             if verbose:
                 debug("OperationError:")
-                debug(" operror-type: " + e.w_type.getname(space).encode('utf-8'))
+                debug(" operror-type: " + e.w_type.getname(space))
                 debug(" operror-value: " + space.text_w(space.str(e.get_w_value(space))))
             return rffi.cast(rffi.INT, -1)
         finally:
@@ -202,7 +202,7 @@
             """)
         except OperationError as e:
             debug("OperationError:")
-            debug(" operror-type: " + e.w_type.getname(space).encode('utf-8'))
+            debug(" operror-type: " + e.w_type.getname(space))
             debug(" operror-value: " + space.text_w(space.str(e.get_w_value(space))))
             return -1
         return 0
diff --git a/pypy/interpreter/test/test_executioncontext.py b/pypy/interpreter/test/test_executioncontext.py
--- a/pypy/interpreter/test/test_executioncontext.py
+++ b/pypy/interpreter/test/test_executioncontext.py
@@ -178,7 +178,7 @@
                 w_class = space.type(seen[0].w_instance)
                 found = 'method %s of %s' % (
                     seen[0].w_function.name,
-                    w_class.getname(space).encode('utf-8'))
+                    w_class.getname(space))
             else:
                 assert isinstance(seen[0], Function)
                 found = 'builtin %s' % seen[0].name
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
@@ -88,7 +88,7 @@
         py_getsetdef.c_doc = rffi.str2charp(doc)
     else:
         py_getsetdef.c_doc = rffi.cast(rffi.CCHARP, 0)
-    py_getsetdef.c_name = rffi.str2charp(getsetprop.getname(space).encode('utf-8'))
+    py_getsetdef.c_name = rffi.str2charp(getsetprop.getname(space))
     # XXX FIXME - actually assign these !!!
     py_getsetdef.c_get = cts.cast('getter', 0)
     py_getsetdef.c_set = cts.cast('setter', 0)
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -762,7 +762,7 @@
 
 def _get_printable_location(w_type):
     return ('bytearray_from_byte_sequence [w_type=%s]' %
-            w_type.getname(w_type.space).encode('utf-8'))
+            w_type.getname(w_type.space))
 
 _byteseq_jitdriver = jit.JitDriver(
     name='bytearray_from_byte_sequence',
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -132,7 +132,7 @@
 
 def _get_printable_location(w_type):
     return ('list__do_extend_from_iterable [w_type=%s]' %
-            w_type.getname(w_type.space).encode('utf-8'))
+            w_type.getname(w_type.space))
 
 
 _do_extend_jitdriver = jit.JitDriver(
diff --git a/pypy/tool/pytest/appsupport.py b/pypy/tool/pytest/appsupport.py
--- a/pypy/tool/pytest/appsupport.py
+++ b/pypy/tool/pytest/appsupport.py
@@ -97,7 +97,7 @@
     def __init__(self, space, operr):
         self.space = space
         self.operr = operr
-        self.typename = operr.w_type.getname(space).encode('utf-8')
+        self.typename = operr.w_type.getname(space)
         self.traceback = AppTraceback(space, self.operr.get_traceback())
         debug_excs = getattr(operr, 'debug_excs', [])
         if debug_excs:


More information about the pypy-commit mailing list