diff options
author | adityacp | 2016-09-08 18:18:57 +0530 |
---|---|---|
committer | adityacp | 2016-09-08 18:18:57 +0530 |
commit | 06daf67b7a579c113d17eacd4bfb0651ab169be4 (patch) | |
tree | 6bfaff0f34983c4bdd8d86c1d5d0a01b20f2d1cc /yaksh | |
parent | e6571406379196834a7dfc623ba691fea3c6027e (diff) | |
download | online_test-06daf67b7a579c113d17eacd4bfb0651ab169be4.tar.gz online_test-06daf67b7a579c113d17eacd4bfb0651ab169be4.tar.bz2 online_test-06daf67b7a579c113d17eacd4bfb0651ab169be4.zip |
added condition to check traceback
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/code_evaluator.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py index d0cac62..e139b55 100644 --- a/yaksh/code_evaluator.py +++ b/yaksh/code_evaluator.py @@ -114,7 +114,10 @@ class CodeEvaluator(object): except Exception: exc_type, exc_value, exc_tb = sys.exc_info() tb_list = traceback.format_exception(exc_type, exc_value, exc_tb) - del tb_list[1:3] + if len(tb_list) > 2: + del tb_list[1:3] + else: + pass err = "Error: {0}".format("".join(tb_list)) finally: # Set back any original signal handler. |