diff options
-rw-r--r-- | snekbox/api/resources/eval.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py index 1df6c1b..80c9ec4 100644 --- a/snekbox/api/resources/eval.py +++ b/snekbox/api/resources/eval.py @@ -77,9 +77,13 @@ class EvalResource: args = req.media.get("args", ("-c",)) try: - result = self.nsjail.python3(code, py_args=args) + result, attachments = self.nsjail.python3(code, py_args=args) except Exception: log.exception("An exception occurred while trying to process the request") raise falcon.HTTPInternalServerError - resp.media = {"stdout": result.stdout, "returncode": result.returncode} + resp.media = { + "stdout": result.stdout, + "returncode": result.returncode, + "attachments": [atc.to_dict() for atc in attachments], + } |