X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/8854bd74bdb76307df1d695b6820ab4e25b7088f..930d78e3e2045f6f810c73edd81f44321b039ea5:/catacomb/__init__.py diff --git a/catacomb/__init__.py b/catacomb/__init__.py index eb3344a..6ae1062 100644 --- a/catacomb/__init__.py +++ b/catacomb/__init__.py @@ -68,6 +68,15 @@ del _dlflags, _odlflags ## For the benefit of the default keyreporter, we need the program name. _base._ego(_sys.argv[0]) +## Register our module. +_base._set_home_module(_sys.modules[__name__]) +def default_lostexchook(why, ty, val, tb): + """`catacomb.lostexchook(WHY, TY, VAL, TB)' reports lost exceptions.""" + _sys.stderr.write("\n\n!!! LOST EXCEPTION: %s\n" % why) + _sys.excepthook(ty, val, tb) + _sys.stderr.write("\n") +lostexchook = default_lostexchook + ## How to fix a name back into the right identifier. Alas, the rules are not ## consistent. def _fixname(name):