diff roundup/backends/back_anydbm.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 462b0f76fce8
children 506c7ee9a385
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Thu Aug 24 17:55:02 2017 -0400
+++ b/roundup/backends/back_anydbm.py	Thu Aug 24 22:21:37 2017 -0400
@@ -633,7 +633,7 @@
         # not exist
         try:
             db = self.opendb('journals.%s'%classname, 'r')
-        except anydbm.error, error:
+        except anydbm.error as error:
             if str(error) == "need 'c' or 'n' flag to open new db":
                 raise IndexError('no such %s %s'%(classname, nodeid))
             elif error.args[0] != 2:
@@ -2183,7 +2183,7 @@
         if propname == 'content':
             try:
                 return self.db.getfile(self.classname, nodeid, None)
-            except IOError, strerror:
+            except IOError as strerror:
                 # XXX by catching this we don't see an error in the log.
                 return 'ERROR reading file: %s%s\n%s\n%s'%(
                         self.classname, nodeid, poss_msg, strerror)

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