[pypy-commit] pypy space-newtext: two places where newtext is better than newbytes

arigo pypy.commits at gmail.com
Wed Feb 15 04:06:54 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: space-newtext
Changeset: r90142:19dc3e9fb603
Date: 2017-02-15 09:36 +0100
http://bitbucket.org/pypy/pypy/changeset/19dc3e9fb603/

Log:	two places where newtext is better than newbytes

diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -153,7 +153,7 @@
             else:
                 return self.newint(x)
         if isinstance(x, str):
-            return self.newbytes(x)
+            return self.newtext(x)
         if isinstance(x, unicode):
             return self.newunicode(x)
         if isinstance(x, float):
@@ -547,7 +547,7 @@
         if isinstance(w_slice, W_SliceObject):
             a, b, c = w_slice.indices3(self, self.int_w(w_length))
             return (a, b, c)
-        w_indices = self.getattr(w_slice, self.newbytes('indices'))
+        w_indices = self.getattr(w_slice, self.newtext('indices'))
         w_tup = self.call_function(w_indices, w_length)
         l_w = self.unpackiterable(w_tup)
         if not len(l_w) == 3:


More information about the pypy-commit mailing list