]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix while statements with non-bool conditions in `_pyrepl` (#127509)
authorRUANG (James Roy) <rruuaanng@outlook.com>
Wed, 1 Jan 2025 20:39:28 +0000 (04:39 +0800)
committerGitHub <noreply@github.com>
Wed, 1 Jan 2025 20:39:28 +0000 (20:39 +0000)
Fix non-bool value conditions

Lib/_pyrepl/simple_interact.py
Lib/_pyrepl/unix_console.py

index 342a4b58bfd0f3f1bb5d42a50356b67c072d71f3..a5033496712a73dbd660ae2b16be6a91ecd54a3a 100644 (file)
@@ -138,7 +138,7 @@ def run_multiline_interactive_console(
 
         return False
 
-    while 1:
+    while True:
         try:
             try:
                 sys.stdout.flush()
index 2576b938a34c64092ae4f07c3feb0dfc5e2c1017..63e8fc24dd7625a8c7603374b96d89de5dfc908b 100644 (file)
@@ -786,7 +786,7 @@ class UnixConsole(Console):
         # only if the bps is actually needed (which I'm
         # betting is pretty unlkely)
         bps = ratedict.get(self.__svtermstate.ospeed)
-        while 1:
+        while True:
             m = prog.search(fmt)
             if not m:
                 os.write(self.output_fd, fmt)