[pypy-commit] pypy py3.5-newtext: some post-merge fixes

arigo pypy.commits at gmail.com
Mon Feb 13 11:15:11 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5-newtext
Changeset: r90094:72f4854167dd
Date: 2017-02-13 17:14 +0100
http://bitbucket.org/pypy/pypy/changeset/72f4854167dd/

Log:	some post-merge fixes

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -78,7 +78,7 @@
 
     def getname(self, space):
         try:
-            return space.text_w(space.getattr(self, space.newtext('__name__')))
+            return space.unicode_w(space.getattr(self, space.newtext('__name__')))
         except OperationError as e:
             if e.match(space, space.w_TypeError) or e.match(space, space.w_AttributeError):
                 return u'?'
diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py
--- a/pypy/interpreter/mixedmodule.py
+++ b/pypy/interpreter/mixedmodule.py
@@ -30,7 +30,7 @@
         Module.install(self)
         if hasattr(self, "submodules"):
             space = self.space
-            name = space.unwrap(self.w_name)
+            name = space.text_w(self.w_name)
             for sub_name, module_cls in self.submodules.iteritems():
                 if module_cls.submodule_name is None:
                     module_cls.submodule_name = sub_name
diff --git a/pypy/interpreter/pyparser/error.py b/pypy/interpreter/pyparser/error.py
--- a/pypy/interpreter/pyparser/error.py
+++ b/pypy/interpreter/pyparser/error.py
@@ -28,7 +28,7 @@
             if len(self.text) != offset:
                 text, _ = str_decode_utf_8(self.text, len(self.text),
                                            'replace')
-            w_text = space.newtext(text)
+            w_text = space.newunicode(text)
         if self.filename is not None:
             w_filename = space.wrap_fsdecoded(self.filename)
         return space.newtuple([space.wrap(self.msg),
diff --git a/pypy/interpreter/test/test_argument.py b/pypy/interpreter/test/test_argument.py
--- a/pypy/interpreter/test/test_argument.py
+++ b/pypy/interpreter/test/test_argument.py
@@ -98,6 +98,7 @@
 
     def str_w(self, s):
         return str(s)
+    text_w = str_w
 
     def unicode_w(self, s):
         return unicode(s)
@@ -352,6 +353,7 @@
                 raise OperationError(ValueError, None)
             return str(w)
         space.unicode_w = unicode_w
+        space.text_w = unicode_w
         excinfo = py.test.raises(OperationError, Arguments, space, [],
                                  ["a"], [1], w_starstararg={None: 1})
         assert excinfo.value.w_type is TypeError
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -779,7 +779,7 @@
 
 def descr_get__name__(space, w_type):
     w_type = _check(space, w_type)
-    return space.newtext(w_type.getname(space))
+    return space.newunicode(w_type.getname(space))
 
 def descr_set__name__(space, w_type, w_value):
     w_type = _check(space, w_type)


More information about the pypy-commit mailing list