From 9eff7b0f0bb740fb069b18b729ef2a0b45221aee Mon Sep 17 00:00:00 2001 From: Rnhmjoj Date: Wed, 3 Dec 2014 21:00:49 +0100 Subject: [PATCH] Clean exit --- pirate-get.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pirate-get.py b/pirate-get.py index 014a3d7..29f7c93 100755 --- a/pirate-get.py +++ b/pirate-get.py @@ -18,6 +18,7 @@ # along with pirate-get. If not, see . import os +import sys import random import re import string @@ -503,7 +504,7 @@ def main(): "[q] Quit", sep="\n") elif code == 'q': print("User Cancelled.") - break + sys.exit(0) elif code == 'd': print_descriptions(choices) elif code == 'f': @@ -518,7 +519,7 @@ def main(): print('Exception:') print(str(e)) choices = () - break + sys.exit(1) if config.getboolean('SaveToFile', 'enabled'): # Save to file is enabled