summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorSarah Owens <sarato@inkylabs.com>2012-09-09 15:37:57 -0700
committerSarah Owens <sarato@inkylabs.com>2012-10-23 21:35:59 -0700
commita5be53f9c809009e67f217c00b8f30246aacc237 (patch)
tree7ab0da1fd31968eee882de81df8c9b93ae52fdfb /project.py
parent9ed12c5d9cda1f010bc173b0bc622d59e96b0dd0 (diff)
downloadgit-repo-a5be53f9c809009e67f217c00b8f30246aacc237.tar.gz
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
Diffstat (limited to 'project.py')
-rw-r--r--project.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/project.py b/project.py
index 472b1d32..96feb94b 100644
--- a/project.py
+++ b/project.py
@@ -1044,7 +1044,7 @@ class Project(object):
1044 1044
1045 try: 1045 try:
1046 self._Checkout(revid, quiet=True) 1046 self._Checkout(revid, quiet=True)
1047 except GitError, e: 1047 except GitError as e:
1048 syncbuf.fail(self, e) 1048 syncbuf.fail(self, e)
1049 return 1049 return
1050 self._CopyFiles() 1050 self._CopyFiles()
@@ -1066,7 +1066,7 @@ class Project(object):
1066 branch.name) 1066 branch.name)
1067 try: 1067 try:
1068 self._Checkout(revid, quiet=True) 1068 self._Checkout(revid, quiet=True)
1069 except GitError, e: 1069 except GitError as e:
1070 syncbuf.fail(self, e) 1070 syncbuf.fail(self, e)
1071 return 1071 return
1072 self._CopyFiles() 1072 self._CopyFiles()
@@ -1151,7 +1151,7 @@ class Project(object):
1151 try: 1151 try:
1152 self._ResetHard(revid) 1152 self._ResetHard(revid)
1153 self._CopyFiles() 1153 self._CopyFiles()
1154 except GitError, e: 1154 except GitError as e:
1155 syncbuf.fail(self, e) 1155 syncbuf.fail(self, e)
1156 return 1156 return
1157 else: 1157 else:
@@ -1723,7 +1723,7 @@ class Project(object):
1723 continue 1723 continue
1724 try: 1724 try:
1725 os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst) 1725 os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
1726 except OSError, e: 1726 except OSError as e:
1727 if e.errno == errno.EPERM: 1727 if e.errno == errno.EPERM:
1728 raise GitError('filesystem must support symlinks') 1728 raise GitError('filesystem must support symlinks')
1729 else: 1729 else:
@@ -1786,7 +1786,7 @@ class Project(object):
1786 os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst) 1786 os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst)
1787 else: 1787 else:
1788 raise GitError('cannot overwrite a local work tree') 1788 raise GitError('cannot overwrite a local work tree')
1789 except OSError, e: 1789 except OSError as e:
1790 if e.errno == errno.EPERM: 1790 if e.errno == errno.EPERM:
1791 raise GitError('filesystem must support symlinks') 1791 raise GitError('filesystem must support symlinks')
1792 else: 1792 else: