summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-25 12:27:16 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-25 12:27:16 (GMT)
commita7a4b4916fa0df4edd5fdde2d235b874cf5ea181 (patch)
tree3d61630ce8ceba4cdb94297b8b5b5245ab7a27ad /Lib
parent6e39015f611bd0dbeada39c53d087f4df0d4ce73 (diff)
parent0fd557647d9957542a68972854a227d2def5f5f3 (diff)
downloadcpython-a7a4b4916fa0df4edd5fdde2d235b874cf5ea181.zip
cpython-a7a4b4916fa0df4edd5fdde2d235b874cf5ea181.tar.gz
cpython-a7a4b4916fa0df4edd5fdde2d235b874cf5ea181.tar.bz2
Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/idlelib/PyShell.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 3c203d0..106e32b 100755
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1384,6 +1384,9 @@ class PseudoInputFile(PseudoFile):
line = self._line_buffer or self.shell.readline()
if size < 0:
size = len(line)
+ eol = line.find('\n', 0, size)
+ if eol >= 0:
+ size = eol + 1
self._line_buffer = line[size:]
return line[:size]