diff options
author | adityacp | 2018-04-06 15:01:01 +0530 |
---|---|---|
committer | adityacp | 2018-04-06 15:01:01 +0530 |
commit | 463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162 (patch) | |
tree | f588d67b8e0390099f79d3d696bce80e8c2536a2 /yaksh/grader.py | |
parent | 680b741cb066bae3e074c9feade61bf7792ef384 (diff) | |
download | online_test-463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162.tar.gz online_test-463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162.tar.bz2 online_test-463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162.zip |
Add error line number in error output
Diffstat (limited to 'yaksh/grader.py')
-rw-r--r-- | yaksh/grader.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yaksh/grader.py b/yaksh/grader.py index a721236..d81470b 100644 --- a/yaksh/grader.py +++ b/yaksh/grader.py @@ -148,14 +148,15 @@ class Grader(object): error.append( prettify_exceptions("TimeoutException", self.timeout_msg) ) - except Exception: + 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 if len(tb_list) > 2: del tb_list[1:3] error.append( prettify_exceptions( - exc_type.__name__, str(exc_value), "".join(tb_list) + exc_type.__name__, str(exc_value), "".join(tb_list), line_no=line_no ) ) finally: |