From: Terry Jan Reedy Date: Thu, 3 Feb 2022 19:44:35 +0000 (-0500) Subject: bpo-45975: IDLE - Remove extraneous parens (GH-31107) X-Git-Tag: v3.11.0a6~316^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=916d0d822c79933f4c420f7a36f16f3eb788646b;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py index a94327533d86..8545c63e1435 100644 --- a/Lib/idlelib/pyparse.py +++ b/Lib/idlelib/pyparse.py @@ -179,7 +179,7 @@ class Parser: # 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 ac04ed94dd47..ca83173877ad 100644 --- a/Lib/idlelib/replace.py +++ b/Lib/idlelib/replace.py @@ -158,8 +158,8 @@ class ReplaceDialog(SearchDialogBase): 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 01f8d65426ab..aaa9b5ce8d18 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -482,7 +482,7 @@ class StdInputFile(StdioFile): 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: