Hey everyone. For some reason when I call my “clean up def” to exit the game, nothing happens while if I call for exit in the main code, it exits just fine.
sys.exit() actually works by raising the exception SystemExit. Normally, when you raise SystemExit all the way to the top, it exits the program.
In your try…except handler, you have caught the SystemExit exception, and printed it out. If you want to allow it to exit normally instead, you could treat SystemExit as a special case, e.g.: