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
diff --git a/git_config.py b/git_config.py
index afaa6f1..ae28855 100644
--- a/git_config.py
+++ b/git_config.py
@@ -449,7 +449,7 @@
try:
Trace(': %s', ' '.join(command))
p = subprocess.Popen(command)
- except Exception, e:
+ except Exception as e:
_ssh_master = False
print >>sys.stderr, \
'\nwarn: cannot enable ssh control master for %s:%s\n%s' \
@@ -592,9 +592,9 @@
else:
host, port = info.split()
self._review_url = self._SshReviewUrl(userEmail, host, port)
- except urllib2.HTTPError, e:
+ except urllib2.HTTPError as e:
raise UploadError('%s: %s' % (self.review, str(e)))
- except urllib2.URLError, e:
+ except urllib2.URLError as e:
raise UploadError('%s: %s' % (self.review, str(e)))
REVIEW_CACHE[u] = self._review_url