summaryrefslogtreecommitdiff
path: root/yaksh/python_code_evaluator.py
diff options
context:
space:
mode:
authoradityacp2016-02-19 16:19:14 +0530
committeradityacp2016-03-11 15:31:51 +0530
commit1ddc29e1cb703557ab43d14318c279fce8fc609e (patch)
tree630405785e5ede4a3adf267fa4e0825fc2001312 /yaksh/python_code_evaluator.py
parentef3cd39ebdf9d9fc9011ba4bc470ec5018bb8077 (diff)
downloadonline_test-1ddc29e1cb703557ab43d14318c279fce8fc609e.tar.gz
online_test-1ddc29e1cb703557ab43d14318c279fce8fc609e.tar.bz2
online_test-1ddc29e1cb703557ab43d14318c279fce8fc609e.zip
Frontend design changes
remove older change Remove further changes interface changes interface changes small views.py change change in code evaluator code evaluator changes python code evaluator change exception changes in code evaluator and test cases for python Update test_python_evaluation.py changed variable name in test case Views.py conflict resolve
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'