diff options
author | Guido van Rossum <guido@python.org> | 1997-08-15 00:45:26 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-15 00:45:26 (GMT) |
commit | ff712aa8abde6a1a892ec39bb124cfd4a7cb992a (patch) | |
tree | c5cf2853501f0678abb92fb8e91315b3ee0d8a76 /Lib/dos-8x3/stringio.py | |
parent | f84a539d38ffe79a4eb940c4a2071294fa734fe8 (diff) | |
download | cpython-ff712aa8abde6a1a892ec39bb124cfd4a7cb992a.zip cpython-ff712aa8abde6a1a892ec39bb124cfd4a7cb992a.tar.gz cpython-ff712aa8abde6a1a892ec39bb124cfd4a7cb992a.tar.bz2 |
The usual.
Diffstat (limited to 'Lib/dos-8x3/stringio.py')
-rwxr-xr-x | Lib/dos-8x3/stringio.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/dos-8x3/stringio.py b/Lib/dos-8x3/stringio.py index bbd9428..dba38e4 100755 --- a/Lib/dos-8x3/stringio.py +++ b/Lib/dos-8x3/stringio.py @@ -64,7 +64,7 @@ class StringIO: r = self.buf[self.pos:newpos] self.pos = newpos return r - def readline(self): + def readline(self, length=None): if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] @@ -73,6 +73,9 @@ class StringIO: newpos = self.len else: newpos = i+1 + if length is not None: + if self.pos + length < newpos: + newpos = self.pos + length r = self.buf[self.pos:newpos] self.pos = newpos return r |