summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-09-23 16:36:55 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-09-23 16:36:55 +0200
commit0e44fc38d85723db970089f6628a3f5093c515bd (patch)
tree8f9c2e356e69e020e4df30025126e60bc27e89ab /python
parenta5297968519e2bbaaaedee5dcafb84e2821fe27b (diff)
Only show ^C on interrupt if user code is running
Diffstat (limited to 'python')
-rwxr-xr-xpython/interpreter.py3
1 files changed, 2 insertions, 1 deletions
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()