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
This commit is contained in:
Sarah Owens
2012-09-09 15:37:57 -07:00
parent 9ed12c5d9c
commit a5be53f9c8
10 changed files with 32 additions and 32 deletions

View File

@@ -1044,7 +1044,7 @@ class Project(object):
try:
self._Checkout(revid, quiet=True)
except GitError, e:
except GitError as e:
syncbuf.fail(self, e)
return
self._CopyFiles()
@@ -1066,7 +1066,7 @@ class Project(object):
branch.name)
try:
self._Checkout(revid, quiet=True)
except GitError, e:
except GitError as e:
syncbuf.fail(self, e)
return
self._CopyFiles()
@@ -1151,7 +1151,7 @@ class Project(object):
try:
self._ResetHard(revid)
self._CopyFiles()
except GitError, e:
except GitError as e:
syncbuf.fail(self, e)
return
else:
@@ -1723,7 +1723,7 @@ class Project(object):
continue
try:
os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
except OSError, e:
except OSError as e:
if e.errno == errno.EPERM:
raise GitError('filesystem must support symlinks')
else:
@@ -1786,7 +1786,7 @@ class Project(object):
os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst)
else:
raise GitError('cannot overwrite a local work tree')
except OSError, e:
except OSError as e:
if e.errno == errno.EPERM:
raise GitError('filesystem must support symlinks')
else: