]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
idlelib: replace 'while 1' with 'while True' (GH-94827)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 14 Jul 2022 01:27:20 +0000 (18:27 -0700)
committerGitHub <noreply@github.com>
Thu, 14 Jul 2022 01:27:20 +0000 (18:27 -0700)
(cherry picked from commit 6a15f918b5a6fb5113d5332ebf27df1d5360e66c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Lib/idlelib/editor.py
Lib/idlelib/history.py
Lib/idlelib/hyperparser.py
Lib/idlelib/rpc.py
Lib/idlelib/run.py
Lib/idlelib/searchengine.py

index 6c52efd655e12192782f0376cc9b6ca33cf24ac0..859a288b4bc6772aa8c00d23a9581e73c70ed989 100644 (file)
@@ -1301,7 +1301,7 @@ class EditorWindow:
         want = ((have - 1) // self.indentwidth) * self.indentwidth
         # Debug prompt is multilined....
         ncharsdeleted = 0
-        while 1:
+        while True:
             chars = chars[:-1]
             ncharsdeleted = ncharsdeleted + 1
             have = len(chars.expandtabs(tabwidth))
index 7ce09253eff5c96c20ebea6a13b2dbefa39f75e4..621c5812fc25c98deae7c34d267b76c9ed7390f5 100644 (file)
@@ -65,7 +65,7 @@ class History:
                     self.text.bell()
                     return
         nprefix = len(prefix)
-        while 1:
+        while True:
             pointer += -1 if reverse else 1
             if pointer < 0 or pointer >= nhist:
                 self.text.bell()
index 77baca782b3fdc07c89a93aaffde082fed2988d2..76144ee8fb30f5eb143d4fe50343393892c23154 100644 (file)
@@ -237,9 +237,9 @@ class HyperParser:
         last_identifier_pos = pos
         postdot_phase = True
 
-        while 1:
+        while True:
             # Eat whitespaces, comments, and if postdot_phase is False - a dot
-            while 1:
+            while True:
                 if pos>brck_limit and rawtext[pos-1] in self._whitespace_chars:
                     # Eat a whitespace
                     pos -= 1
index 8efcf048fa3aa20d60efa1ff7973778f642922dd..62eec84c9c8d090f79505f1873b190161f7129b6 100644 (file)
@@ -307,7 +307,7 @@ class SocketIO:
         self.debug("_getresponse:myseq:", myseq)
         if threading.current_thread() is self.sockthread:
             # this thread does all reading of requests or responses
-            while 1:
+            while True:
                 response = self.pollresponse(myseq, wait)
                 if response is not None:
                     return response
@@ -417,7 +417,7 @@ class SocketIO:
         self.responses and notify the owning thread.
 
         """
-        while 1:
+        while True:
             # send queued response if there is one available
             try:
                 qmsg = response_queue.get(0)
index aaa9b5ce8d181f5dc3ea001aefe929b56b486ba2..577c49eb67b20d1f83095b3224d341cd88ad1656 100644 (file)
@@ -145,7 +145,7 @@ def main(del_exitfunc=False):
                                   args=((LOCALHOST, port),))
     sockthread.daemon = True
     sockthread.start()
-    while 1:
+    while True:
         try:
             if exit_now:
                 try:
index eddef581ab40a752b287ee43b052d2e65731d12d..0684142f43644af5ad3a3a9f98d99111f51ed431 100644 (file)
@@ -165,7 +165,7 @@ class SearchEngine:
         wrapped = 0
         startline = line
         chars = text.get("%d.0" % line, "%d.0" % (line+1))
-        while 1:
+        while True:
             m = search_reverse(prog, chars[:-1], col)
             if m:
                 if ok or m.start() < col: