From: RUANG (James Roy) Date: Wed, 1 Jan 2025 20:39:28 +0000 (+0800) Subject: Fix while statements with non-bool conditions in `_pyrepl` (#127509) X-Git-Tag: v3.14.0a4~156 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a327810169982e3782bdefc2247789a71aa79b43;p=thirdparty%2FPython%2Fcpython.git Fix while statements with non-bool conditions in `_pyrepl` (#127509) Fix non-bool value conditions --- diff --git a/Lib/_pyrepl/simple_interact.py b/Lib/_pyrepl/simple_interact.py index 342a4b58bfd0..a5033496712a 100644 --- a/Lib/_pyrepl/simple_interact.py +++ b/Lib/_pyrepl/simple_interact.py @@ -138,7 +138,7 @@ def run_multiline_interactive_console( return False - while 1: + while True: try: try: sys.stdout.flush() diff --git a/Lib/_pyrepl/unix_console.py b/Lib/_pyrepl/unix_console.py index 2576b938a34c..63e8fc24dd76 100644 --- a/Lib/_pyrepl/unix_console.py +++ b/Lib/_pyrepl/unix_console.py @@ -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)