summaryrefslogtreecommitdiff
path: root/yaksh/python_code_evaluator.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-04-01 16:07:14 +0530
committerPrabhu Ramachandran2016-04-01 16:07:14 +0530
commitd65ba142c47780fe3ff818f583f110453d31a92f (patch)
treee5a30e1499998e81db16d3e771b67afebc34341a /yaksh/python_code_evaluator.py
parent424e6c94237a1d9b5a24ed6c2a49a433034304ca (diff)
parent17a1eacda10beea98b4bbddf3d3dd06378a74eee (diff)
downloadonline_test-d65ba142c47780fe3ff818f583f110453d31a92f.tar.gz
online_test-d65ba142c47780fe3ff818f583f110453d31a92f.tar.bz2
online_test-d65ba142c47780fe3ff818f583f110453d31a92f.zip
Merge pull request #84 from adityacp/templates
Quiz display template changes
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'