Commit 788116d6 authored by Rok Mandeljc's avatar Rok Mandeljc

IPython: fixed buffer reset in case of KeyboardInterrupt

Do not try to call a reset() on input_splitter when input splitter
is not used; clear our internal buffer instead.
parent db13e8fa
......@@ -179,7 +179,10 @@ class IterableIPShell:
line = self.IP.raw_input(self.prompt)
except KeyboardInterrupt:
self.IP.write('\nKeyboardInterrupt\n')
self.IP.input_splitter.reset()
if self.no_input_splitter:
self.lines = []
else:
self.IP.input_splitter.reset()
except:
self.IP.showtraceback()
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment