mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +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:
@@ -173,7 +173,7 @@ class Template(object):
|
||||
fd = open(self.absolute_filename)
|
||||
try:
|
||||
content = fd.read().decode(TEMPLATE_ENCODING)
|
||||
except UnicodeDecodeError, e:
|
||||
except UnicodeDecodeError as e:
|
||||
message = '%s in %s' % (
|
||||
e[4], self.absolute_filename.encode('UTF-8', 'ignore'))
|
||||
raise UnicodeDecodeError(*(e.args[:4] + (message,)))
|
||||
|
||||
Reference in New Issue
Block a user