From a5be53f9c809009e67f217c00b8f30246aacc237 Mon Sep 17 00:00:00 2001 From: Sarah Owens Date: Sun, 9 Sep 2012 15:37:57 -0700 Subject: Use modern Python exception syntax "except Exception as e" instead of "except Exception, e" This is part of a transition to supporting Python 3. Python >= 2.6 support "as" syntax. Note: this removes Python 2.5 support. Change-Id: I309599f3981bba2b46111c43102bee38ff132803 --- subcmds/sync.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'subcmds/sync.py') diff --git a/subcmds/sync.py b/subcmds/sync.py index e68a025e..d16605ff 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -417,7 +417,7 @@ uncommitted changes are present' % project.relpath # in the .netrc file. print >>sys.stderr, 'No credentials found for %s in .netrc' % \ parse_result.hostname - except netrc.NetrcParseError, e: + except netrc.NetrcParseError as e: print >>sys.stderr, 'Error parsing .netrc file: %s' % e if (username and password): @@ -464,11 +464,11 @@ uncommitted changes are present' % project.relpath else: print >>sys.stderr, 'error: %s' % manifest_str sys.exit(1) - except (socket.error, IOError, xmlrpclib.Fault), e: + except (socket.error, IOError, xmlrpclib.Fault) as e: print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%s' % ( self.manifest.manifest_server, e) sys.exit(1) - except xmlrpclib.ProtocolError, e: + except xmlrpclib.ProtocolError as e: print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%d %s' % ( self.manifest.manifest_server, e.errcode, e.errmsg) sys.exit(1) -- cgit v1.2.3-54-g00ecf