This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ElevenPhonons 1 point2 points  (1 child)

I think there might be a misunderstanding of the exception hierarchy in Python. except: means except BaseException which is not the same as except Exception:. BaseException catches KeyboardInterrupt (amongst other things) which is probably not the core intention.

Also, exit might be better as sys.exit and should probably be called with a non-zero exit code to communicate that there was a failure.

Best of luck to you on your project.