]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix issue #1707. When raw_input() was removed, it was incorrectly replaced
authorGuido van Rossum <guido@python.org>
Wed, 2 Jan 2008 02:55:27 +0000 (02:55 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 2 Jan 2008 02:55:27 +0000 (02:55 +0000)
with sys.stdin.readline().  I wonder how many other places are affected
by the same bug?

Lib/code.py

index 58af88390a8d99d469d3961dd9657618fc52d129..8962927d71f576602f39bcc1c2fff698001a302b 100644 (file)
@@ -253,13 +253,12 @@ class InteractiveConsole(InteractiveInterpreter):
         The returned line does not include the trailing newline.
         When the user enters the EOF key sequence, EOFError is raised.
 
-        The base implementation uses sys.stdin.readline(); a subclass
-        may replace this with a different implementation.
+        The base implementation uses the built-in function
+        input(); a subclass may replace this with a different
+        implementation.
 
         """
-        sys.stdout.write(prompt)
-        sys.stdout.flush()
-        return sys.stdin.readline()
+        return input(prompt)