Check value in except

This commit is contained in:
Scott Zawalski 2010-11-16 09:48:09 -08:00
parent 01c62e5da6
commit 4e85f966a4

View File

@ -136,8 +136,9 @@ def RevGitPushWithRetry(retries=5):
cros_build_lib.RunCommand('git push', shell=True)
break
except cros_build_lib.RunCommandError:
print 'Error pushing changes trying again (%s/%s)' % (retry, retries)
time.sleep(5*retry)
if retry < retries:
print 'Error pushing changes trying again (%s/%s)' % (retry, retries)
time.sleep(5*retry)
else:
raise GitPushFailed('Failed to push change after %s retries' % retries)