From 8db46c1b01497f756bf2452b24dcfcd13b1beb60 Mon Sep 17 00:00:00 2001 From: JasonGrace2282 Date: Sun, 13 Oct 2024 22:45:31 -0400 Subject: [PATCH] fix sample grader not actually capturing output --- scripts/sample_grader.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/sample_grader.py b/scripts/sample_grader.py index 50f0de51..ffa310a5 100644 --- a/scripts/sample_grader.py +++ b/scripts/sample_grader.py @@ -9,9 +9,14 @@ import subprocess import sys -process = subprocess.run([sys.executable, sys.argv[1]], check=False) +process = subprocess.run( + [sys.executable, sys.argv[1]], + capture_output=True, + check=False, +) + if process.returncode != 0: - print("Encountered exception for test case 0:") + # let the student see the error print(process.stderr) print("Score: 0%") else: