summaryrefslogtreecommitdiff
path: root/yaksh/grader.py
diff options
context:
space:
mode:
authoradityacp2018-04-13 12:17:29 +0530
committeradityacp2018-04-13 12:17:29 +0530
commit575da538337da6afb23cc159870853b6457797d3 (patch)
treefbf75cd5a5dfe701005dd0571e92e74f2a87163e /yaksh/grader.py
parenta3e540aa209be57318de6c3e2548c56e68fdeded (diff)
downloadonline_test-575da538337da6afb23cc159870853b6457797d3.tar.gz
online_test-575da538337da6afb23cc159870853b6457797d3.tar.bz2
online_test-575da538337da6afb23cc159870853b6457797d3.zip
Change in python test, grader and request handler
- Add try except in grader to get exceptions for python stdio and python assertion evaluation - Add additional tests - Add condition in request handler to avoid error if codemirror is not instantiated
Diffstat (limited to 'yaksh/grader.py')
-rw-r--r--yaksh/grader.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/yaksh/grader.py b/yaksh/grader.py
index 9bc4e5c..2a246b8 100644
--- a/yaksh/grader.py
+++ b/yaksh/grader.py
@@ -151,7 +151,10 @@ class Grader(object):
except Exception as e:
exc_type, exc_value, exc_tb = sys.exc_info()
tb_list = traceback.format_exception(exc_type, exc_value, exc_tb)
- line_no = e.lineno
+ try:
+ line_no = e.lineno
+ except AttributeError:
+ line_no = traceback.extract_tb(exc_tb)[-1][1]
if len(tb_list) > 2:
del tb_list[1:3]
error.append(