mirror of
https://github.com/Dev-Wiki/git-repo.git
synced 2025-12-14 00:24:05 +08:00
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:
10
project.py
10
project.py
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user