lib.exception_handling.*

exception_handling.py contains functions for handling exceptions generated by user code

Provides

lib.exception_handling.get_user_codeframe(tb)[source]

Modify traceback to only include the user code’s execution frame Always call in this fashion:

e = sys.exc_info()
user_tb = get_user_codeframe(e[2]) or e[2]

so that you can get the original frame back if you need to (this is necessary because copying traceback objects is tricky and this is a good workaround)

Parameters:

tb (TracebackType) – Trace back information

Return type:

Union[TracebackType, bool]