diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-12-13 17:29:16 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-12-13 17:29:16 +0000 |
commit | 414721614f6f550f8d8353b09b178e1d055f1d1f (patch) | |
tree | a5f69d893fc93c290aa5e7801abe5f518b27774a /Lib/StringIO.py | |
parent | 4895af4ef1c91679e642c0fc81f584aecc26a7ea (diff) | |
download | cpython-git-414721614f6f550f8d8353b09b178e1d055f1d1f.tar.gz |
make StringIO like other file objects in that readline(-1) has no effect #7348
Diffstat (limited to 'Lib/StringIO.py')
-rw-r--r-- | Lib/StringIO.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 054ad4c3d5..340fae1229 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py @@ -158,7 +158,7 @@ class StringIO: newpos = self.len else: newpos = i+1 - if length is not None: + if length is not None and length > 0: if self.pos + length < newpos: newpos = self.pos + length r = self.buf[self.pos:newpos] |