diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-25 12:24:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-25 12:24:17 (GMT) |
commit | 0b6b335253949df26c369ecce35199e9dc2b86f5 (patch) | |
tree | c07749fc9be79e30404401814fb4587b5c0ef76f /Lib/idlelib/PyShell.py | |
parent | b712873a63fb0b0776d86dab5436ff8952eba02c (diff) | |
download | cpython-0b6b335253949df26c369ecce35199e9dc2b86f5.zip cpython-0b6b335253949df26c369ecce35199e9dc2b86f5.tar.gz cpython-0b6b335253949df26c369ecce35199e9dc2b86f5.tar.bz2 |
Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rwxr-xr-x | Lib/idlelib/PyShell.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index be64aca..dc3cfe6 100755 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1393,6 +1393,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] |