Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r89573:37f628884dfb
Date: 2017-01-15 09:33 +0100
http://bitbucket.org/pypy/pypy/changeset/37f628884dfb/
Log: issue2457: copy some changes that should be done in py3.5-newtext,
but that really fix bugs
diff --git a/pypy/interpreter/pycode.py b/pypy/interpreter/pycode.py
--- a/pypy/interpreter/pycode.py
+++ b/pypy/interpreter/pycode.py
@@ -318,13 +318,13 @@
return space.newtuple(self.co_names_w)
def fget_co_varnames(self, space):
- return space.newtuple([space.wrap(name) for name in self.co_varnames])
+ return space.newtuple([space.newtext(name) for name in
self.co_varnames])
def fget_co_cellvars(self, space):
- return space.newtuple([space.wrap(name) for name in self.co_cellvars])
+ return space.newtuple([space.newtext(name) for name in
self.co_cellvars])
def fget_co_freevars(self, space):
- return space.newtuple([space.wrap(name) for name in self.co_freevars])
+ return space.newtuple([space.newtext(name) for name in
self.co_freevars])
def descr_code__eq__(self, w_other):
space = self.space
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
@@ -362,6 +362,9 @@
def newutf8(self, string):
return self.newunicode(decode_utf8(self, string))
+ def newtext(self, s):
+ return self.newunicode(decode_utf8(self, s, allow_surrogates=True))
+
def newunicode(self, uni):
return W_UnicodeObject(uni)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit