diff roundup/cgi/PageTemplates/Expressions.py @ 5248:198b6e810c67

Use Python-3-compatible 'as' syntax for except statements Many raise statements near these are also fixed. So are two ivorrect file encoding marks ('utf8'->'utf-8').
author Eric S. Raymond <esr@thyrsus.com>
date Thu, 24 Aug 2017 22:21:37 -0400
parents 6e3e4f24c753
children 63868084b8bb
line wrap: on
line diff
--- a/roundup/cgi/PageTemplates/Expressions.py	Thu Aug 24 17:55:02 2017 -0400
+++ b/roundup/cgi/PageTemplates/Expressions.py	Thu Aug 24 22:21:37 2017 -0400
@@ -92,7 +92,7 @@
                     ob = call_with_ns(ob, ns, 2)
                 else:
                     ob = ob()
-            except AttributeError, n:
+            except AttributeError as n:
                 if str(n) != '__call__':
                     raise
     return ob
@@ -321,7 +321,7 @@
                 # the object has the attribute "__getitem__"
                 # instead of blindly catching exceptions.
                 o = object[name]
-            except AttributeError, exc:
+            except AttributeError as exc:
                 if str(exc).find('__getitem__') >= 0:
                     # The object does not support the item interface.
                     # Try to re-raise the original attribute error.
@@ -329,7 +329,7 @@
                     # ExtensionClass instances.
                     guarded_getattr(object, name)
                 raise
-            except TypeError, exc:
+            except TypeError as exc:
                 if str(exc).find('unsubscriptable') >= 0:
                     # The object does not support the item interface.
                     # Try to re-raise the original attribute error.

Roundup Issue Tracker: http://roundup-tracker.org/