summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorDavid Riley <davidriley@google.com>2017-04-05 13:50:52 -0700
committerDavid Pursehouse <dpursehouse@collab.net>2017-05-27 13:32:00 +0900
commitaa90021fbc3382fdac6171572c85ee07369c91e1 (patch)
tree076c899c27e43caf5030b21f03527526c660c858 /main.py
parentfddfa6fbac4fcabe712961fa45da8f440ee9426a (diff)
downloadgit-repo-aa90021fbc3382fdac6171572c85ee07369c91e1.tar.gz
Set result if sys.exit() is called by subcommand.
Allows the finally branch to make sure of the return code. Change-Id: I7a796da5b60269cbd71aad953f1b9bb762b8eef8
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.py b/main.py
index c5f1e9c3..f965d7e1 100755
--- a/main.py
+++ b/main.py
@@ -198,6 +198,10 @@ class _Repo(object):
198 else: 198 else:
199 print('error: project group must be enabled for the project in the current directory', file=sys.stderr) 199 print('error: project group must be enabled for the project in the current directory', file=sys.stderr)
200 result = 1 200 result = 1
201 except SystemExit as e:
202 if e.code:
203 result = e.code
204 raise
201 finally: 205 finally:
202 elapsed = time.time() - start 206 elapsed = time.time() - start
203 hours, remainder = divmod(elapsed, 3600) 207 hours, remainder = divmod(elapsed, 3600)