aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Friedrich Bolz-Tereick <cfbolz@gmx.de>2021-03-02 21:27:45 +0100
committerCarl Friedrich Bolz-Tereick <cfbolz@gmx.de>2021-03-02 21:27:45 +0100
commit74709f79ba0f23a7ea45430d8fe758133d21c714 (patch)
tree5f0e5871f14a1660f1439229755445fb6f2cc9d1
parentsome ascii fast paths of latin-1 encoding/decoding (diff)
downloadpypy-74709f79ba0f23a7ea45430d8fe758133d21c714.tar.gz
pypy-74709f79ba0f23a7ea45430d8fe758133d21c714.tar.bz2
pypy-74709f79ba0f23a7ea45430d8fe758133d21c714.zip
woops
-rw-r--r--pypy/objspace/std/unicodeobject.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
index 16edebfb03..1e080f6a40 100644
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -1216,7 +1216,7 @@ def encode_object(space, w_obj, encoding, errors):
if rutf8.has_surrogates(utf8):
utf8 = rutf8.reencode_utf8_with_surrogates(utf8)
return space.newbytes(utf8)
- if (encoding == "latin1" or encoding == "latin-1" and
+ if ((encoding == "latin1" or encoding == "latin-1") and
isinstance(w_obj, W_UnicodeObject) and w_obj.is_ascii()):
return space.newbytes(w_obj._utf8)
return encode(space, w_obj, encoding, errors)