diff options
-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. |