Commit 2a5b6a2a authored by maruel@chromium.org's avatar maruel@chromium.org

Now that CheckCallAndFilter() throws subprocess2.CalledProcessError, use e.returncode.

deferring e.args[0] would throw an error.

TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7859032

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100402 0039d316-1c4b-4281-b951-d872f2087c98
parent 73c87e94
......@@ -506,13 +506,11 @@ class GitWrapper(SCMWrapper):
try:
self._Run(clone_cmd, options, cwd=self._root_dir)
break
except (gclient_utils.Error, subprocess2.CalledProcessError), e:
# TODO(maruel): Hackish, should be fixed by moving _Run() to
# subprocess2.check_output().
# Too bad we don't have access to the actual output.
except subprocess2.CalledProcessError, e:
# Too bad we don't have access to the actual output yet.
# We should check for "transfer closed with NNN bytes remaining to
# read". In the meantime, just make sure .git exists.
if (e.args[0] == 'git command clone returned 128' and
if (e.returncode == 128 and
os.path.exists(os.path.join(self.checkout_path, '.git'))):
print(str(e))
print('Retrying...')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment