From 2a5b6a2abad67df4e64721ec40784b672c770e9e Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Fri, 9 Sep 2011 14:03:12 +0000 Subject: [PATCH] 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 --- gclient_scm.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gclient_scm.py b/gclient_scm.py index 5e64afced..15e9eb9b2 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -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...')