Author: Matti Picus <matti.pi...@gmail.com> Branch: unicode-utf8 Changeset: r95096:7e4c70d0d9eb Date: 2018-09-11 21:40 +0300 http://bitbucket.org/pypy/pypy/changeset/7e4c70d0d9eb/
Log: fixes for failing tests 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 @@ -136,14 +136,14 @@ @staticmethod def convert_arg_to_w_unicode(space, w_other, strict=None): - if isinstance(w_other, W_UnicodeObject): + if space.is_w(space.type(w_other), space.w_unicode): return w_other if space.isinstance_w(w_other, space.w_bytes): return unicode_from_string(space, w_other) if strict: raise oefmt(space.w_TypeError, "%s arg must be None, unicode or str", strict) - return unicode_from_encoded_object(space, w_other, None, "strict") + return unicode_from_encoded_object(space, w_other, 'utf8', "strict") def convert_to_w_unicode(self, space): return self @@ -226,7 +226,7 @@ return space.newtext(_repr_function(self._utf8)) def descr_str(self, space): - return encode_object(space, self, None, None) + return encode_object(space, self, 'utf8', 'strict') def descr_hash(self, space): x = compute_hash(self._utf8) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit