From bc8ad3724986b0282a58d0391666fc90adc776b3 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 30 May 2014 11:41:02 -0400 Subject: [PATCH] init: make prompt for SDK path exit cleanly on Ctrl-C This just makes a clean exit rather than showing a python stacktrace. --- fdroidserver/init.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fdroidserver/init.py b/fdroidserver/init.py index c51b6e59..f55549ab 100644 --- a/fdroidserver/init.py +++ b/fdroidserver/init.py @@ -132,7 +132,12 @@ def main(): # if neither --android-home nor the default sdk_path exist, prompt the user default_sdk_path = '/opt/android-sdk' while not options.no_prompt: - s = raw_input('Enter the path to the Android SDK (' + default_sdk_path + ') here:\n> ') + try: + s = raw_input('Enter the path to the Android SDK (' + + default_sdk_path + ') here:\n> ') + except KeyboardInterrupt: + print('') + sys.exit(1) if re.match('^\s*$', s) is not None: test_config['sdk_path'] = default_sdk_path else: