Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3866)

Unified Diff: gcl.py

Issue 6691034: First pass to transition away for gclient_utils.Error and gclient_utils.CheckedCallError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gclient.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index 6136d1c5a96ee6f198d37ed1606621294b854b90..a845b2b1b43d1cbadebd03b3303bc0d46fdffb11 100755
--- a/gcl.py
+++ b/gcl.py
@@ -39,6 +39,7 @@ from scm import SVN
import fix_encoding
import gclient_utils
import presubmit_support
+import subprocess2
__version__ = '1.2'
@@ -136,7 +137,7 @@ def GetCachedFile(filename, max_age=60*60*24*3, use_root=False):
# First we check if we have a cached version.
try:
cached_file = os.path.join(GetCacheDir(), filename)
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
return None
if (not os.path.exists(cached_file) or
(time.time() - os.stat(cached_file).st_mtime) > max_age):
@@ -168,7 +169,7 @@ def GetCachedFile(filename, max_age=60*60*24*3, use_root=False):
# Exit the loop if the file was found. Override content.
content = '\n'.join(content_array)
break
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
if content_array[0].startswith(
'svn: Can\'t get username or password'):
ErrorExit('Your svn credentials expired. Please run svn update '
@@ -1419,7 +1420,7 @@ def main(argv):
try:
GetRepositoryRoot()
- except gclient_utils.Error:
+ except (gclient_utils.Error, subprocess2.CalledProcessError):
print >> sys.stderr, 'To use gcl, you need to be in a subversion checkout.'
return 1
@@ -1437,7 +1438,7 @@ def main(argv):
return command(argv[1:])
# Unknown command, try to pass that to svn
return CMDpassthru(argv)
- except gclient_utils.Error, e:
+ except (gclient_utils.Error, subprocess2.CalledProcessError), e:
print >> sys.stderr, 'Got an exception'
print >> sys.stderr, str(e)
return 1
« no previous file with comments | « no previous file | gclient.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698