From efa85f17987ecdbbc69dd57d1609ce323ac37a39 Mon Sep 17 00:00:00 2001 From: komoto Date: Thu, 12 May 2022 23:24:14 +0900 Subject: [PATCH] Fix OnHistorySearch range+ error Fix TypeError: unsupported operand type(s) for +: 'range' and 'range' --- wx/py/shell.py | 4 ++-- wx/py/sliceshell.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wx/py/shell.py b/wx/py/shell.py index 0226f131..ce5981fa 100755 --- a/wx/py/shell.py +++ b/wx/py/shell.py @@ -854,8 +854,8 @@ class Shell(editwindow.EditWindow): or (self.historyIndex >= len(self.history)-2): searchOrder = range(len(self.history)) else: - searchOrder = range(self.historyIndex+1, len(self.history)) + \ - range(self.historyIndex) + ls = list(range(len(self.history))) + searchOrder = ls[self.historyIndex+1:] + ls[:self.historyIndex] for i in searchOrder: command = self.history[i] if command[:len(searchText)] == searchText: diff --git a/wx/py/sliceshell.py b/wx/py/sliceshell.py index 3648001a..1bbc643d 100755 --- a/wx/py/sliceshell.py +++ b/wx/py/sliceshell.py @@ -2270,8 +2270,8 @@ class SlicesShell(editwindow.EditWindow): or (self.historyIndex >= len(self.history)-2): searchOrder = range(len(self.history)) else: - searchOrder = range(self.historyIndex+1, len(self.history)) + \ - range(self.historyIndex) + ls = list(range(len(self.history))) + searchOrder = ls[self.historyIndex+1:] + ls[:self.historyIndex] for i in searchOrder: command = self.history[i] if command[:len(searchText)] == searchText: