def gui_printTraceBack(e_type, e_value, tbacklist): # If the mainloop isn't running yet, just display to the terminal. # In debugging mode, always display to the terminal. if debug.debug() or not guitop.getMainLoop(): excepthook.printTraceBack(e_type, e_value, tbacklist) if guitop.getMainLoop(): # Transfer control to the main thread to report errors in the GUI. res = mainthread.runBlock(errorpopup_, (e_type, e_value, tbacklist)) if res == ErrorPopUp.ABORT: from ooflib.common.IO.GUI import quit if not mainthread.runBlock(quit.queryQuit, kwargs=dict(exitstatus=1)): sys.exc_clear() # quitting was cancelled else: # Not aborting. Clear the exception because it can # contain references to objects and prevent garbage # collection. sys.exc_clear()
def subScriptErrorHandler(e_type, e_value, tbacklist): _savedExceptions.append((e_type, e_value, tbacklist)) if debug.debug() or not guitop.getMainLoop(): excepthook.printTraceBack(e_type, e_value, tbacklist)