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 --- git_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git_config.py') diff --git a/git_config.py b/git_config.py index afaa6f15..ae288558 100644 --- a/git_config.py +++ b/git_config.py @@ -449,7 +449,7 @@ def _open_ssh(host, port=None): 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 @@ class Remote(object): 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 -- cgit v1.2.3-54-g00ecf