1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Fixed #18013 -- Use the new 'as' syntax for exceptions.

Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
This commit is contained in:
Claude Paroz
2012-04-28 18:09:37 +02:00
parent eefb00f301
commit 3904b74a3f
107 changed files with 306 additions and 354 deletions

View File

@@ -88,7 +88,7 @@ def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'):
# errors), so that if s is a SafeString, it ends up being a
# SafeUnicode at the end.
s = s.decode(encoding, errors)
except UnicodeDecodeError, e:
except UnicodeDecodeError as e:
if not isinstance(s, Exception):
raise DjangoUnicodeDecodeError(s, *e.args)
else: