From ab6ec5b9fdb21a56edbfaf5a3af0e70357e61295 Mon Sep 17 00:00:00 2001 From: komoto Date: Tue, 26 Apr 2022 22:30:49 +0900 Subject: [PATCH] Fix shell getMultilineCommand Add limitation to avoid an infinite loop at EOF, when programmatically called on the current prompt. --- wx/py/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wx/py/shell.py b/wx/py/shell.py index 0226f131..98934179 100755 --- a/wx/py/shell.py +++ b/wx/py/shell.py @@ -946,7 +946,7 @@ class Shell(editwindow.EditWindow): startpos = self.GetCurrentPos() + ps1size line += 1 self.GotoLine(line) - while self.GetCurLine()[0][:ps2size] == ps2: + while self.GetCurLine()[0][:ps2size] == ps2 and line < self.LineCount: line += 1 self.GotoLine(line) stoppos = self.GetCurrentPos()