It's nice not to have catch-all except, especially to avoid catching SystemExit.
(For context:)
Happened for a case when I tried to auto-restart the bot by relying on systemd to reboot it after exiting cleanly with sys.exit(). Alternatively, os.system(f"kill {os.getpid()}") works but doesn't feel pythonic.
It's nice not to have catch-all
except
, especially to avoid catchingSystemExit
.(For context:) Happened for a case when I tried to auto-restart the bot by relying on systemd to reboot it after exiting cleanly with
sys.exit()
. Alternatively,os.system(f"kill {os.getpid()}")
works but doesn't feel pythonic.