From f0f0de3f92933749a033a6b96a6e05e7317715e3 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 2 May 2017 21:07:50 +0530 Subject: [PATCH] Handle interrupts on input --- spotdl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spotdl.py b/spotdl.py index e224551..d5dd094 100644 --- a/spotdl.py +++ b/spotdl.py @@ -228,6 +228,9 @@ while True: if m.endswith('.m4a.temp'): os.remove('Music/' + m) print('') - command = fixEncoding(raw_input('>> Enter a song/cmd: ')) - print('') - initializeInput(command) + try: + command = fixEncoding(raw_input('>> Enter a song/cmd: ')) + print('') + initializeInput(command) + except KeyboardInterrupt: + graceQuit()