diff --git a/src/wormhole/database.py b/src/wormhole/database.py index b764a24..f6944ff 100644 --- a/src/wormhole/database.py +++ b/src/wormhole/database.py @@ -16,7 +16,7 @@ def get_db(dbfile, stderr=sys.stderr): must_create = not os.path.exists(dbfile) try: db = sqlite3.connect(dbfile) - except (EnvironmentError, sqlite3.OperationalError), e: + except (EnvironmentError, sqlite3.OperationalError) as e: raise DBError("Unable to create/open db file %s: %s" % (dbfile, e)) db.row_factory = sqlite3.Row @@ -29,7 +29,7 @@ def get_db(dbfile, stderr=sys.stderr): try: version = db.execute("SELECT version FROM version").fetchone()[0] - except sqlite3.DatabaseError, e: + except sqlite3.DatabaseError as e: # this indicates that the file is not a compatible database format. # Perhaps it was created with an old version, or it might be junk. raise DBError("db file is unusable: %s" % e) diff --git a/src/wormhole/scripts/runner.py b/src/wormhole/scripts/runner.py index 115a620..0469320 100644 --- a/src/wormhole/scripts/runner.py +++ b/src/wormhole/scripts/runner.py @@ -124,7 +124,7 @@ def run(args, stdout, stderr, executable=None): #rc = command.func(args, stdout, stderr) rc = args.func(args) return rc - except ImportError, e: + except ImportError as e: print >>stderr, "--- ImportError ---" print >>stderr, e print >>stderr, "Please run 'python setup.py build'" diff --git a/src/wormhole/util/ipaddrs.py b/src/wormhole/util/ipaddrs.py index faab34a..8e36a08 100644 --- a/src/wormhole/util/ipaddrs.py +++ b/src/wormhole/util/ipaddrs.py @@ -54,7 +54,7 @@ def _query(path, args, regex): env=env) (output, err) = p.communicate() break - except OSError, e: + except OSError as e: if e.errno == errno.EINTR and trial < TRIES-1: continue raise