From a396eff0594a7d4c14907bfe9ca805397bf85a7b Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 4 Feb 2019 23:34:24 -0600 Subject: [PATCH] runpy: Catch BaseException to get SystemExit, too --- course/page/code_runpy_backend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/course/page/code_runpy_backend.py b/course/page/code_runpy_backend.py index b018db5c..c9f3dacd 100644 --- a/course/page/code_runpy_backend.py +++ b/course/page/code_runpy_backend.py @@ -234,7 +234,7 @@ def run_code(result, run_req): try: maint_ctx["_MODULE_SOURCE_CODE"] = run_req.setup_code exec(setup_code, maint_ctx) - except Exception: + except BaseException: package_exception(result, "setup_error") return @@ -253,7 +253,7 @@ def run_code(result, run_req): try: user_ctx["_MODULE_SOURCE_CODE"] = run_req.user_code exec(user_code, user_ctx) - except Exception: + except BaseException: package_exception(result, "user_error") return @@ -299,7 +299,7 @@ def run_code(result, run_req): exec(test_code, maint_ctx) except GradingComplete: pass - except Exception: + except BaseException: package_exception(result, "test_error") return -- GitLab