summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2016-09-08 18:18:57 +0530
committeradityacp2016-09-08 18:18:57 +0530
commit06daf67b7a579c113d17eacd4bfb0651ab169be4 (patch)
tree6bfaff0f34983c4bdd8d86c1d5d0a01b20f2d1cc /yaksh
parente6571406379196834a7dfc623ba691fea3c6027e (diff)
downloadonline_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.py5
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.