From 3904b74a3f2f92fefe1d39281ed683c52f2fef03 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 28 Apr 2012 18:09:37 +0200 Subject: 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). --- extras/csrf_migration_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extras') diff --git a/extras/csrf_migration_helper.py b/extras/csrf_migration_helper.py index 94b5a20802..0e13163b4f 100755 --- a/extras/csrf_migration_helper.py +++ b/extras/csrf_migration_helper.py @@ -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,))) -- cgit v1.3