[accerciser: 3/5] IPython: fixed buffer reset in case of KeyboardInterrupt



commit 788116d63f53a31f1b92c5d49e01b18f418a6979
Author: Rok Mandeljc <rok mandeljc gmail com>
Date:   Thu Apr 16 20:35:06 2020 +0200

    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.

 plugins/ipython_view.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/plugins/ipython_view.py b/plugins/ipython_view.py
index 23b1553..c8f6a71 100755
--- a/plugins/ipython_view.py
+++ b/plugins/ipython_view.py
@@ -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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]