Simplify surrogate check in to_text() (#18211)

* Simplify surrogate check in to_text()

* Simplify surrogateescape check even further
pull/18250/head
Sijis Aviles 8 years ago committed by Toshio Kuratomi
parent 90b180c815
commit b365f44fa1

@ -173,12 +173,6 @@ def to_text(obj, encoding='utf-8', errors=None, nonstring='simplerepr'):
else:
errors = 'strict'
if errors is None:
if PY3:
errors = 'surrogateescape'
else:
errors = 'replace'
if isinstance(obj, binary_type):
return obj.decode(encoding, errors)

Loading…
Cancel
Save