INNER CODE UNIT · Python

abort_with_exception

autokitteh/autokitteh · runtimes/pythonrt/runner/main.py:140

def abort_with_exception(context, status, err, show_pickle_help=False):
    io = StringIO()
    if show_pickle_help:
        print(pickle_help, file=io)
    for line in format_exception(err):
        io.write(line)
    text = io.getvalue()
    context.abort(status, text)


def set_exception_args(err):
    """Set exception "args" attribute to match __init__ signature so it can be un-pickled.

    See https://stackoverflow.com/questions/41808912/cannot-unpickle-exception-subclass
    """
    code = getattr(err.__init__, "__code__", None)
    if code is None:  # Built-in
        return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…