From 0e44fc38d85723db970089f6628a3f5093c515bd Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 23 Sep 2015 16:36:55 +0200 Subject: Only show ^C on interrupt if user code is running --- python/interpreter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/interpreter.py b/python/interpreter.py index 01c9d4d..dae4d59 100755 --- a/python/interpreter.py +++ b/python/interpreter.py @@ -70,7 +70,7 @@ class MyConsole(code.InteractiveConsole): except KeyboardInterrupt: prompt = '>>> ' buffer = [] - self.write('^C\n') + self.write('\n') except EOFError: break @@ -79,6 +79,7 @@ class MyConsole(code.InteractiveConsole): exec(code, self.locals) except KeyboardInterrupt: # Don't show traceback on SIGINT. + self.write('^C') raise except: self.showtraceback() -- cgit v1.2.1