]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change instances of 'while 1:' in the docs into 'while True:'.
authorCollin Winter <collinw@gmail.com>
Mon, 10 Sep 2007 00:49:57 +0000 (00:49 +0000)
committerCollin Winter <collinw@gmail.com>
Mon, 10 Sep 2007 00:49:57 +0000 (00:49 +0000)
Doc/howto/curses.rst
Doc/library/cgi.rst
Doc/library/logging.rst
Doc/library/smtplib.rst
Doc/library/socket.rst

index e16d07af3a5dbab824b61267e0ed0f6567e55c4a..6f537088cb0f6777ecd68d77fcc65c1b8d839fd0 100644 (file)
@@ -377,7 +377,7 @@ value returned to constants such as :const:`curses.KEY_PPAGE`,
 :const:`curses.KEY_HOME`, or :const:`curses.KEY_LEFT`.  Usually the main loop of
 your program will look something like this::
 
-   while 1:
+   while True:
        c = stdscr.getch()
        if c == ord('p'): PrintDocument()
        elif c == ord('q'): break  # Exit the while()
index 84262f5c6bb246c61df332b1388cf644ae0623d8..86b8c47da3e62392425cb246a083823476d56f3f 100644 (file)
@@ -142,7 +142,7 @@ attribute::
    if fileitem.file:
        # It's an uploaded file; count lines
        linecount = 0
-       while 1:
+       while True:
            line = fileitem.file.readline()
            if not line: break
            linecount = linecount + 1
index fb4bc4c7dd7fb3b6ab2ea0eb6df1fc1aa6111de7..fb2116458d8ea7306e44d39241bce86e63a98051 100644 (file)
@@ -783,7 +783,7 @@ module. Here is a basic working example::
            followed by the LogRecord in pickle format. Logs the record
            according to whatever policy is configured locally.
            """
-           while 1:
+           while True:
                chunk = self.connection.recv(4)
                if len(chunk) < 4:
                    break
index 286a7256fb20d86aafd1d8c3b0e373480cd117f9..0653a5035915e63284c4f0e4204742a2f64dd356 100644 (file)
@@ -322,7 +322,7 @@ example doesn't do any processing of the :rfc:`822` headers.  In particular, the
    # Add the From: and To: headers at the start!
    msg = ("From: %s\r\nTo: %s\r\n\r\n"
           % (fromaddr, ", ".join(toaddrs)))
-   while 1:
+   while True:
        try:
            line = raw_input()
        except EOFError:
index 7512e56d3e8c904f22ffae3b23111aacf2190368..19970ad46b564c93586f7fd1c3b4b74691435d2d 100644 (file)
@@ -734,7 +734,7 @@ The first two examples support IPv4 only. ::
    s.listen(1)
    conn, addr = s.accept()
    print('Connected by', addr)
-   while 1:
+   while True:
        data = conn.recv(1024)
        if not data: break
        conn.send(data)
@@ -788,7 +788,7 @@ sends traffic to the first one connected successfully. ::
        sys.exit(1)
    conn, addr = s.accept()
    print('Connected by', addr)
-   while 1:
+   while True:
        data = conn.recv(1024)
        if not data: break
        conn.send(data)