Merge pull request #469 from piquadrat/feature/fix-unicodedecoreerror-call
fixed instantiation of UnicodeDecodeError in force_text
This commit is contained in:
commit
f4d6d2fe85
|
@ -55,7 +55,7 @@ def force_text(s, encoding='utf-8', strings_only=False, errors='strict'):
|
|||
s = s.decode(encoding, errors)
|
||||
except UnicodeDecodeError as e:
|
||||
if not isinstance(s, Exception):
|
||||
raise UnicodeDecodeError(s, *e.args)
|
||||
raise UnicodeDecodeError(*e.args)
|
||||
else:
|
||||
# If we get to here, the caller has passed in an Exception
|
||||
# subclass populated with non-ASCII bytestring data without a
|
||||
|
|
Loading…
Reference in New Issue