From cf7cb1a2bf40516dc571d1d90c12b632dcd9b8c8 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:44:23 -0800 Subject: [PATCH] bpo-45975: IDLE - Remove extraneous parens (GH-31107) mistakenly included in 3 files in previous PR and backported both to 3.10 and 3.9. (cherry picked from commit 916d0d822c79933f4c420f7a36f16f3eb788646b) Co-authored-by: Terry Jan Reedy --- Lib/idlelib/pyparse.py | 2 +- Lib/idlelib/replace.py | 4 ++-- Lib/idlelib/run.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py index a94327533d8..8545c63e143 100644 --- a/Lib/idlelib/pyparse.py +++ b/Lib/idlelib/pyparse.py @@ -179,7 +179,7 @@ def find_good_parse_start(self, is_char_in_string): # Peeking back worked; look forward until _synchre no longer # matches. i = pos + 1 - while (m := _synchre(code, i)): + while m := _synchre(code, i): s, i = m.span() if not is_char_in_string(s): pos = s diff --git a/Lib/idlelib/replace.py b/Lib/idlelib/replace.py index 70d761db126..7e55a4a43a4 100644 --- a/Lib/idlelib/replace.py +++ b/Lib/idlelib/replace.py @@ -156,8 +156,8 @@ def replace_all(self, event=None): first = last = None # XXX ought to replace circular instead of top-to-bottom when wrapping text.undo_block_start() - while (res := self.engine.search_forward( - text, prog, line, col, wrap=False, ok=ok)): + while res := self.engine.search_forward( + text, prog, line, col, wrap=False, ok=ok): line, m = res chars = text.get("%d.0" % line, "%d.0" % (line+1)) orig = m.group() diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 4246f497cb3..d6f1049612f 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -468,7 +468,7 @@ def read(self, size=-1): result = self._line_buffer self._line_buffer = '' if size < 0: - while (line := self.shell.readline()): + while line := self.shell.readline(): result += line else: while len(result) < size: