Author: fijal
Branch: unicode-utf8
Changeset: r90311:16e1ade09c1c
Date: 2017-02-22 18:31 +0100
http://bitbucket.org/pypy/pypy/changeset/16e1ade09c1c/
Log: rename newunicode to utf8
diff --git a/pypy/interpreter/pyparser/parsestring.py
b/pypy/interpreter/pyparser/parsestring.py
--- a/pypy/interpreter/pyparser/parsestring.py
+++ b/pypy/interpreter/pyparser/parsestring.py
@@ -63,7 +63,7 @@
v, length = unicodehelper.decode_raw_unicode_escape(space, substr)
else:
v, length = unicodehelper.decode_unicode_escape(space, substr)
- return space.newunicode(v, length)
+ return space.newutf8(v, length)
need_encoding = (encoding is not None and
encoding != "utf-8" and encoding != "utf8" and
diff --git a/pypy/module/__builtin__/operation.py
b/pypy/module/__builtin__/operation.py
--- a/pypy/module/__builtin__/operation.py
+++ b/pypy/module/__builtin__/operation.py
@@ -30,7 +30,7 @@
s, lgt = unichr_as_utf8(code)
except ValueError:
raise oefmt(space.w_ValueError, "unichr() arg out of range")
- return space.newunicode(s, lgt)
+ return space.newutf8(s, lgt)
def len(space, w_obj):
"len(object) -> integer\n\nReturn the number of items of a sequence or
mapping."
diff --git a/pypy/objspace/std/marshal_impl.py
b/pypy/objspace/std/marshal_impl.py
--- a/pypy/objspace/std/marshal_impl.py
+++ b/pypy/objspace/std/marshal_impl.py
@@ -405,7 +405,7 @@
def unmarshal_unicode(space, u, tc):
arg = u.get_str()
length = unicodehelper.check_utf8(space, arg)
- return space.newunicode(arg, length)
+ return space.newutf8(arg, length)
@marshaller(W_SetObject)
def marshal_set(space, w_set, m):
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
@@ -347,7 +347,7 @@
return self.w_None
return self.newtext(s)
- def newunicode(self, utf8s, length):
+ def newutf8(self, utf8s, length):
assert utf8s is not None
assert isinstance(utf8s, str)
return W_UnicodeObject(utf8s, length)
diff --git a/pypy/objspace/std/unicodeobject.py
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -562,7 +562,7 @@
unicodehelper.decode_error_handler(space)(None,
'ascii', "ordinal not in range(128)", s, e.pos, e.pos+1)
assert False
- return space.newunicode(s, len(s))
+ return space.newutf8(s, len(s))
if encoding == 'utf-8':
yyy
s = space.charbuf_w(w_obj)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit