server/migractions.py
changeset 8695 358d8bed9626
parent 8694 d901c36bcfce
child 8696 0bb18407c053
--- a/server/migractions.py	Thu Feb 14 15:39:23 2013 +0100
+++ b/server/migractions.py	Thu Feb 14 15:38:25 2013 +0100
@@ -155,7 +155,7 @@
         try:
             return super(ServerMigrationHelper, self).cmd_process_script(
                   migrscript, funcname, *args, **kwargs)
-        except ExecutionError, err:
+        except ExecutionError as err:
             sys.stderr.write("-> %s\n" % err)
         except BaseException:
             self.rollback()
@@ -193,7 +193,7 @@
             for source in repo.sources:
                 try:
                     source.backup(osp.join(tmpdir, source.uri), self.confirm, format=format)
-                except Exception, ex:
+                except Exception as ex:
                     print '-> error trying to backup %s [%s]' % (source.uri, ex)
                     if not self.confirm('Continue anyway?', default='n'):
                         raise SystemExit(1)
@@ -252,7 +252,7 @@
                 continue
             try:
                 source.restore(osp.join(tmpdir, source.uri), self.confirm, drop, format)
-            except Exception, exc:
+            except Exception as exc:
                 print '-> error trying to restore %s [%s]' % (source.uri, exc)
                 if not self.confirm('Continue anyway?', default='n'):
                     raise SystemExit(1)
@@ -398,7 +398,7 @@
             try:
                 sqlexec(open(fpath).read(), self.session.system_sql, False,
                         delimiter=';;')
-            except Exception, exc:
+            except Exception as exc:
                 print '-> ERROR:', exc, ', skipping', fpath
 
     # schema synchronization internals ########################################
@@ -1457,7 +1457,7 @@
             if not ask_confirm or self.confirm('Execute rql: %s ?' % msg):
                 try:
                     res = execute(rql, kwargs, build_descr=build_descr)
-                except Exception, ex:
+                except Exception as ex:
                     if self.confirm('Error: %s\nabort?' % ex, pdb=True):
                         raise
         return res
@@ -1551,7 +1551,7 @@
                 raise StopIteration
         try:
             return self._h._cw.execute(rql, kwargs)
-        except Exception, ex:
+        except Exception as ex:
             if self._h.confirm('Error: %s\nabort?' % ex):
                 raise
             else: