summaryrefslogtreecommitdiff
path: root/yaksh/python_code_evaluator.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/python_code_evaluator.py')
-rw-r--r--yaksh/python_code_evaluator.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yaksh/python_code_evaluator.py b/yaksh/python_code_evaluator.py
index 0c473cf..c87c420 100644
--- a/yaksh/python_code_evaluator.py
+++ b/yaksh/python_code_evaluator.py
@@ -6,7 +6,7 @@ from os.path import join
import importlib
# local imports
-from code_evaluator import CodeEvaluator
+from code_evaluator import CodeEvaluator, TimeoutException
class PythonCodeEvaluator(CodeEvaluator):
@@ -29,6 +29,10 @@ class PythonCodeEvaluator(CodeEvaluator):
fname, lineno, func, text = info[-1]
text = str(test_code).splitlines()[lineno-1]
err = "{0} {1} in: {2}".format(type.__name__, str(value), text)
+ except TimeoutException:
+ raise
+ except Exception:
+ err = traceback.format_exc(limit=0)
else:
success = True
err = 'Correct answer'