def debugger_hook(exc, value, tb): if (not hasattr(sys.stderr, "isatty") or not sys.stderr.isatty() or exc in (SyntaxError, IndentationError, KeyboardInterrupt)): sys.__excepthook__(exc, value, tb) else: from pycopia.fepy import debugger debugger.post_mortem(tb, exc, value)
def debugger_hook(exc, value, tb): if (not hasattr(sys.stderr, "isatty") or not sys.stderr.isatty() or exc in (SyntaxError, IndentationError, KeyboardInterrupt)): # We don't have a tty-like device, or it was a SyntaxError, so # call the default hook. sys.__excepthook__(exc, value, tb) else: from pycopia import debugger debugger.post_mortem(tb, exc, value)