import threading def noop(): pass threading.Thread.BUG = True thread = threading.Thread(target=noop) thread.start() try: print("join...") thread.join() except BaseException as exc: print(f"join failed with: {exc!r}") print("join again...") # should just work but hangs thread.join()