diff roundup/cgi/PageTemplates/TALES.py @ 5378:35ea9b1efc14

Python 3 preparation: "raise" syntax. Changing "raise Exception, value" to "raise Exception(value)". Tool-assisted patch. Particular cases to check carefully are the one place in frontends/ZRoundup/ZRoundup.py where a string exception needed to be fixed, and the one in roundup/cgi/client.py involving raising an exception with a traceback (requires three-argument form of raise in Python 2, which as I understand it requires exec() to avoid a Python 3 syntax error).
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 21:39:58 +0000
parents 12fe83f90f0d
children 0942fe89e82e
line wrap: on
line diff
--- a/roundup/cgi/PageTemplates/TALES.py	Tue Jul 24 21:36:02 2018 +0000
+++ b/roundup/cgi/PageTemplates/TALES.py	Tue Jul 24 21:39:58 2018 +0000
@@ -112,10 +112,10 @@
 
     def registerType(self, name, handler):
         if not _valid_name(name):
-            raise RegistrationError, 'Invalid Expression type "%s".' % name
+            raise RegistrationError('Invalid Expression type "%s".' % name)
         types = self.types
         if types.has_key(name):
-            raise RegistrationError, (
+            raise RegistrationError(
                 'Multiple registrations for Expression type "%s".' %
                 name)
         types[name] = handler
@@ -134,7 +134,7 @@
         try:
             handler = self.types[type]
         except KeyError:
-            raise CompilerError, (
+            raise CompilerError(
                 'Unrecognized expression type "%s".' % type)
         return handler(type, expr, self)
 

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