summaryrefslogtreecommitdiff
path: root/yaksh/grader.py
diff options
context:
space:
mode:
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(