The call to wait will fail if the user terminates the program (which triggers kill_all()) because the process is already removed from self.processes
When a user terminates the program, the atexit callback is called as well as the termination signal handlers. This ends up triggering kill_all twice and leads to "Terminating background processes..." being output twice. I moved the print statement so it only runs if there are processes to terminate.
2 small updates in this PR:
wait
will fail if the user terminates the program (which triggerskill_all()
) because the process is already removed fromself.processes
atexit
callback is called as well as the termination signal handlers. This ends up triggeringkill_all
twice and leads to "Terminating background processes..." being output twice. I moved the print statement so it only runs if there are processes to terminate.