Commit ed5b355e authored by Reinout van Rees's avatar Reinout van Rees

Fixes #73: propagate exit code from restart.

A restarted project's exit code is now properly propagated. This makes
buildout more reliable in automatically-run situations.
parent bc19672c
...@@ -1807,7 +1807,11 @@ def main(args=None): ...@@ -1807,7 +1807,11 @@ def main(args=None):
command, args) command, args)
getattr(buildout, command)(args) getattr(buildout, command)(args)
except SystemExit: except SystemExit:
pass logging.shutdown()
# Make sure we properly propagate an exit code from a restarted
# buildout process.
exit_code = sys.exc_info()[1]
sys.exit(exit_code)
except Exception: except Exception:
v = sys.exc_info()[1] v = sys.exc_info()[1]
_doing() _doing()
...@@ -1828,10 +1832,10 @@ def main(args=None): ...@@ -1828,10 +1832,10 @@ def main(args=None):
traceback.print_exception(*exc_info) traceback.print_exception(*exc_info)
sys.exit(1) sys.exit(1)
finally: finally:
logging.shutdown() logging.shutdown()
if sys.version_info[:2] < (2, 4): if sys.version_info[:2] < (2, 4):
def reversed(iterable): def reversed(iterable):
result = list(iterable); result = list(iterable);
......
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