Mercurial > p > roundup > code
diff roundup/backends/back_anydbm.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 | 62de601bdf6f |
| children | 23b8e6067f7c |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Tue Jul 24 21:36:02 2018 +0000 +++ b/roundup/backends/back_anydbm.py Tue Jul 24 21:39:58 2018 +0000 @@ -241,12 +241,12 @@ """A convenient way of calling self.getclass(classname).""" if classname in self.classes: return self.classes[classname] - raise AttributeError, classname + raise AttributeError(classname) def addclass(self, cl): cn = cl.classname if cn in self.classes: - raise ValueError, cn + raise ValueError(cn) self.classes[cn] = cl # add default Edit and View permissions @@ -1186,10 +1186,10 @@ return propvalues if 'creation' in propvalues or 'activity' in propvalues: - raise KeyError, '"creation" and "activity" are reserved' + raise KeyError('"creation" and "activity" are reserved') if 'id' in propvalues: - raise KeyError, '"id" is reserved' + raise KeyError('"id" is reserved') if self.db.journaltag is None: raise hyperdb.DatabaseError(_('Database open read-only'))
