#!/usr/bin/python import threading def thread_work(): raise RuntimeError('something awful that should not be ignored') t = threading.Thread(target=thread_work) t.start() t.join() print('Everything seems just fine') # even though calling `thread_work()` in the main thread would trigger a non-zero system exit