Author: Ronan Lamy <ronan.l...@gmail.com> Branch: utf8-io Changeset: r93201:26f1724ee623 Date: 2017-11-28 19:21 +0000 http://bitbucket.org/pypy/pypy/changeset/26f1724ee623/
Log: Remove newunicode() and unicode_w() again diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -1760,10 +1760,6 @@ def utf8_w(self, w_obj): return w_obj.utf8_w(self) - def unicode_w(self, w_obj): - # XXX: kill me! - return w_obj.utf8_w(self).decode('utf-8') - def convert_to_w_unicode(self, w_obj): return w_obj.convert_to_w_unicode(self) diff --git a/pypy/module/_io/test/test_interp_textio.py b/pypy/module/_io/test/test_interp_textio.py --- a/pypy/module/_io/test/test_interp_textio.py +++ b/pypy/module/_io/test/test_interp_textio.py @@ -27,7 +27,8 @@ w_newline=space.newtext(mode)) lines = [] while True: - line = space.unicode_w(w_textio.readline_w(space, space.newint(limit))) + w_line = w_textio.readline_w(space, space.newint(limit)) + line = space.utf8_w(w_line).decode('utf-8') if limit > 0: assert len(line) <= limit if line: 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 @@ -377,13 +377,6 @@ assert isinstance(s, str) # on pypy3, this decodes the byte string return W_BytesObject(s) # with the filesystem encoding - def newunicode(self, unistr): - # XXX: kill me! - assert isinstance(unistr, unicode) - utf8s = unistr.encode("utf-8") - length, flag = rutf8.check_utf8(utf8s, True) - return self.newutf8(utf8s, length, flag) - def type(self, w_obj): jit.promote(w_obj.__class__) return w_obj.getclass(self) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit