The bare except
catches SystemExit
so the sys.exit()
call is prevented from causing the program from exiting.
Move sys.exit()
out of the try.
Also I don’t like to see a bare except
without a logging.exception('')
in it.
0
solved how to stop a program in try/except [duplicate]