Thanks. that got rid of the error, but I have to manually close the console window. Not something I want to keep doing. Laziness maybe.
I googled sys.exit exception, and it seems it’s a thing with python (python sys.exit causes exception). Which is good, because VS usually don’t have bugs. If any they get fixed pronto.
I am looking into how best to go about getting a clean exit. Currently, I am looking at this.
I’ll see how it goes. Thanks.
sys.exit() does throw an exception, because that’s how it works—a SystemExit exception, which is supposed to be handled by the runtime normally. If the IDE is complaining about this, that is certainly a bug (or at least a very peculiar behaviour) of the IDE.
Ah. No I did not see that actually, but I just tried it. It doesn’t do anything.
PS
I’m good to go though.
I’ve been reading up on python, and exiting. Learning a lot… I hope.
def finalizeExit(self):
try:
sys.exit(0)
except SystemExit:
print("Program terminated with SystemExit exception")
# The finally clause is part of the crashing-application
# strategy. You use this clause to perform any required
# last-minute tasks. Normally, the finally clause is quite
# short and uses only calls that are likely to succeed
# without further problem.
finally:
print("Cleanup")
sys.exit(0)