import sys

def exception_handler(type, value, traceback):
    print('hui')

sys.excepthook = exception_handler

1/0