From fadc1fba1822a5bd89c4f3dc567c7c036f2e9aa2 Mon Sep 17 00:00:00 2001 From: LINUX_ADMIN <73735838+linux-admin0001@users.noreply.github.com> Date: Sun, 22 Aug 2021 13:01:46 +0300 Subject: [PATCH] Fixed bug with sys.stdin.readline() --- bpython/curtsies.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bpython/curtsies.py b/bpython/curtsies.py index 139bbae3..5b57585e 100644 --- a/bpython/curtsies.py +++ b/bpython/curtsies.py @@ -108,10 +108,12 @@ def process_event_and_paint(self, e): self.scroll_offset += scrolled raise else: - array, cursor_pos = self.paint() - scrolled = self.window.render_to_terminal(array, cursor_pos) - self.scroll_offset += scrolled - + try: + array, cursor_pos = self.paint() + scrolled = self.window.render_to_terminal(array, cursor_pos) + self.scroll_offset += scrolled + except TypeError: + ... def mainloop(self, interactive=True, paste=None): if interactive: # Add custom help command