diff options
author | Guido van Rossum <guido@python.org> | 1996-01-25 17:34:14 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-01-25 17:34:14 (GMT) |
commit | f7476c5088e6f459f866901219e1b5b084fb0750 (patch) | |
tree | 43841d688b05f10f697489d454c950aaafcddcea | |
parent | 06d74418e5262f52ae9a21095b4cdb4c3d7fc876 (diff) | |
download | cpython-f7476c5088e6f459f866901219e1b5b084fb0750.zip cpython-f7476c5088e6f459f866901219e1b5b084fb0750.tar.gz cpython-f7476c5088e6f459f866901219e1b5b084fb0750.tar.bz2 |
fix default arg for read() -- should be -1
-rw-r--r-- | Lib/StringIO.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 90f848a..12d19a1 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py @@ -48,8 +48,8 @@ class StringIO: self.pos = max(0, pos) def tell(self): return self.pos - def read(self, n = 0): - if n <= 0: + def read(self, n = -1): + if n < 0: newpos = len(self.buf) else: newpos = min(self.pos+n, len(self.buf)) |