scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 395 forks source link

Fix naked except #192

Closed m3at closed 5 years ago

m3at commented 5 years ago

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.