aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2021-12-26 14:02:48 -0800
committerGravatar MarkKoz <[email protected]>2021-12-26 14:02:48 -0800
commitc9ecbee42019bd416dba48a35cd6f4575e9cf2ed (patch)
tree36b02576ba1c2e1381fb88f506cdd4f52e58c428
parentTest argument parsing for entry point (diff)
Forward the NsJail exit code from the entrypoint
-rw-r--r--snekbox/__main__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/snekbox/__main__.py b/snekbox/__main__.py
index f92a48c..1a33587 100644
--- a/snekbox/__main__.py
+++ b/snekbox/__main__.py
@@ -1,4 +1,5 @@
import argparse
+import sys
from snekbox.nsjail import NsJail
@@ -39,6 +40,9 @@ def main() -> None:
result = NsJail().python3(args.code, nsjail_args=args.nsjail_args, py_args=args.py_args)
print(result.stdout)
+ if result.returncode != 0:
+ sys.exit(result.returncode)
+
if __name__ == "__main__":
main()