Skip to content

Commit c4e2c03

Browse files
committed
check python3
1 parent c1ae813 commit c4e2c03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mirror/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ def utf8_encoded(s, encoding="utf8"):
292292
Return a utf8 encoded string of s
293293
294294
"""
295+
if is_python3():
296+
return decode_string(s, encoding).encode("utf8") if isinstance(s, bytes) else s.encode("utf8")
297+
295298
if isinstance(s, str):
296299
s = decode_string(s, encoding).encode("utf8")
297300
elif isinstance(s, unicode):

0 commit comments

Comments
 (0)