mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-08 16:14:26 +00:00
Set result if sys.exit() is called by subcommand.
Allows the finally branch to make sure of the return code. Change-Id: I7a796da5b60269cbd71aad953f1b9bb762b8eef8
This commit is contained in:
parent
fddfa6fbac
commit
aa90021fbc
4
main.py
4
main.py
@ -198,6 +198,10 @@ class _Repo(object):
|
|||||||
else:
|
else:
|
||||||
print('error: project group must be enabled for the project in the current directory', file=sys.stderr)
|
print('error: project group must be enabled for the project in the current directory', file=sys.stderr)
|
||||||
result = 1
|
result = 1
|
||||||
|
except SystemExit as e:
|
||||||
|
if e.code:
|
||||||
|
result = e.code
|
||||||
|
raise
|
||||||
finally:
|
finally:
|
||||||
elapsed = time.time() - start
|
elapsed = time.time() - start
|
||||||
hours, remainder = divmod(elapsed, 3600)
|
hours, remainder = divmod(elapsed, 3600)
|
||||||
|
Loading…
Reference in New Issue
Block a user