]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45975: IDLE - Remove extraneous parens (GH-31107)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 3 Feb 2022 20:44:23 +0000 (12:44 -0800)
committerGitHub <noreply@github.com>
Thu, 3 Feb 2022 20:44:23 +0000 (12:44 -0800)
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 <tjreedy@udel.edu>
Lib/idlelib/pyparse.py
Lib/idlelib/replace.py
Lib/idlelib/run.py

index a94327533d865abb8e665cf14dc252b40028f6f4..8545c63e1435d46c8534c5a24d01834c392257d7 100644 (file)
@@ -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
index 70d761db126308ed4809c26be4bbc02ca6bc0949..7e55a4a43a44bb07dd46fa1c33029f8db27109de 100644 (file)
@@ -156,8 +156,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()
index 4246f497cb382b6047f49897c745ff1b2ad73cc5..d6f1049612f71bd37d3c3a06f36ad0e2648bb308 100644 (file)
@@ -468,7 +468,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: