Kaydet (Commit) 84126f27 authored tarafından Vytis Banaitis's avatar Vytis Banaitis Kaydeden (comit) Tim Graham

Refs #23919 -- Removed unneeded code in force_text().

Unneeded since 7b2f2e74.
üst ed3215ad
......@@ -62,13 +62,10 @@ def force_text(s, encoding='utf-8', strings_only=False, errors='strict'):
if strings_only and is_protected_type(s):
return s
try:
if not issubclass(type(s), str):
if isinstance(s, bytes):
s = str(s, encoding, errors)
else:
s = str(s)
if isinstance(s, bytes):
s = str(s, encoding, errors)
else:
str(s, encoding, errors)
s = str(s)
except UnicodeDecodeError as e:
if not isinstance(s, Exception):
raise DjangoUnicodeDecodeError(s, *e.args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment