Merge pull request #469 from piquadrat/feature/fix-unicodedecoreerror-call

fixed instantiation of UnicodeDecodeError in force_text
This commit is contained in:
Xavier Ordoquy 2014-09-25 02:12:26 +02:00
commit f4d6d2fe85
1 changed files with 1 additions and 1 deletions

View File

@ -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