Commit 0814076d authored by S. Zeid's avatar S. Zeid

[cli/engine/command] StopIteration and SystemExit should actually stop the command

*facepalm*
parent acfabb19
......@@ -183,11 +183,13 @@ class Command(object):
self.return_code = int(exc.args[0])
except (TypeError, ValueError):
self.return_code = 127
break
except SystemExit, exc:
try:
self.return_code = int(exc.code)
except (TypeError, ValueError):
self.return_code = 127
break
except Exception, exc:
tb = traceback.format_exc()
yield output.traceback(tb)
......@@ -289,5 +291,5 @@ class Command(object):
for item in out:
yield item
if r != None:
if r is not None:
raise StopIteration(r)
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