From 2e0c078e7cc2b8cd0722f27a7612a016838aa829 Mon Sep 17 00:00:00 2001 From: Vane11ope Date: Sun, 5 Jul 2020 04:55:10 +0900 Subject: [PATCH] Use -1 as an initial value for the pos --- mitmproxy/tools/console/commander/commander.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mitmproxy/tools/console/commander/commander.py b/mitmproxy/tools/console/commander/commander.py index 85e488273..47cf1962a 100644 --- a/mitmproxy/tools/console/commander/commander.py +++ b/mitmproxy/tools/console/commander/commander.py @@ -1,4 +1,3 @@ -import sys import abc import typing @@ -29,12 +28,12 @@ class ListCompleter(Completer): if o.startswith(start): self.options.append(o) self.options.sort() - self.pos = sys.maxsize + self.pos = -1 def cycle(self, forward: bool = True) -> str: if not self.options: return self.start - if self.pos == sys.maxsize: + if self.pos == -1: self.pos = 0 if forward else len(self.options) - 1 else: delta = 1 if forward else -1