i have a process/threadpoolexecutor in a context manager, at keyboardinterrupt i want to close all threads or processes while keeping the error completely silent
in the main program i catch it and exiting, however i cant manage to silence the error in child processes
try:
with ProcessPoolExecutor() as executor:
# do stuff
# then run future.result() to raise errors
except KeyboardInterrupt:
# exit silently
return
except Exception:
# handle other errors
my code looks like this, i need the same thing for both thread and processes
in short the issue is that even with this, it prints the traceback from child processes receiving keyboardinterrupt, all i want is for that error to be silent from them