I have a single-threaded Python application. The standard way in which this application gets shut down is by sending it SIGINT and letting the various with: and
with: