Mercurial > p > roundup > code
diff roundup/cgi/PageTemplates/PythonExpr.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 | 6e3e4f24c753 |
| children | c4774b9f483c |
line wrap: on
line diff
--- a/roundup/cgi/PageTemplates/PythonExpr.py Tue Jul 24 21:36:02 2018 +0000 +++ b/roundup/cgi/PageTemplates/PythonExpr.py Tue Jul 24 21:39:58 2018 +0000 @@ -34,8 +34,8 @@ exec 'def f():\n return %s\n' % expr.strip() in d self._f = d['f'] except: - raise CompilerError, ('Python expression error:\n' - '%s: %s') % exc_info()[:2] + raise CompilerError(('Python expression error:\n' + '%s: %s') % exc_info()[:2]) self._get_used_names() def _get_used_names(self):
