##// END OF EJS Templates
Fix showing SystemExit exception raise inside except handler (#14503)...
Fix showing SystemExit exception raise inside except handler (#14503) Doing something like this: ```python try: 5 / 0 except Exception as e: raise SystemExit ``` was hitting an error inside UltraTB, creating a long traceback of its internals (which, ironically, UltraTB itself then displays correctly :-). `ListTB.get_exception_only()` calls the `ListTB.structured_traceback()` method *specifically* - even if `self` is a subclass, it won't use the subclass's method. However, the exception chaining in that method uses recursion by calling `self.structured_traceback()`, which will use a subclass's method. Tuples were added as an option there to support exception chaining, but not all of the machinery in connected classes expects a tuple. This just skips the exception chaining logic for the `etb=None` case, when we're showing the exception only. I'm not sure this is necessarily the best fix, but I didn't want to spend too much time following code around a module that's old enough to vote. Closes #12104

File last commit:

r28782:9b49aad9
r28830:d5762c16 merge
Show More
_process_emscripten.py
22 lines | 503 B | text/x-python | PythonLexer
/ IPython / utils / _process_emscripten.py
"""Emscripten-specific implementation of process utilities.
This file is only meant to be imported by process.py, not by end-users.
"""
from ._process_common import arg_split
def system(cmd):
raise OSError("Not available")
def getoutput(cmd):
raise OSError("Not available")
def check_pid(cmd):
raise OSError("Not available")
# `arg_split` is still used by magics regardless of whether we are on a posix/windows/emscipten
__all__ = ["system", "getoutput", "check_pid", "arg_split"]