Commit db09153a authored by Cyril Guilloud's avatar Cyril Guilloud
Browse files

Merge branch '2774-exception-in-show_result-makes-shell-to-quit' into 'master'

Resolve "Exception in `show_result` makes shell to quit"

Closes #2774

See merge request bliss/bliss!3726
parents e91b65b2 4dfeda81
Pipeline #47132 failed with stages
in 121 minutes and 25 seconds
......@@ -365,11 +365,16 @@ class BlissRepl(NoThreadPythonRepl, metaclass=Singleton):
# NB: next methods are overloaded
##
def show_result(self, result):
if hasattr(result, "__info__"):
result = Info(result)
logging.getLogger("user_input").info(result)
elogbook.command(result)
return super().show_result(result)
try:
if hasattr(result, "__info__"):
result = Info(result)
logging.getLogger("user_input").info(result)
elogbook.command(result)
except BaseException:
# display exception, but do not propagate and make shell to die
sys.excepthook(*sys.exc_info())
else:
return super().show_result(result)
def _handle_keyboard_interrupt(self, e: KeyboardInterrupt) -> None:
sys.excepthook(*sys.exc_info())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment