summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-01-25 17:34:14 (GMT)
committerGuido van Rossum <guido@python.org>1996-01-25 17:34:14 (GMT)
commitf7476c5088e6f459f866901219e1b5b084fb0750 (patch)
tree43841d688b05f10f697489d454c950aaafcddcea /Lib
parent06d74418e5262f52ae9a21095b4cdb4c3d7fc876 (diff)
downloadcpython-f7476c5088e6f459f866901219e1b5b084fb0750.zip
cpython-f7476c5088e6f459f866901219e1b5b084fb0750.tar.gz
cpython-f7476c5088e6f459f866901219e1b5b084fb0750.tar.bz2
fix default arg for read() -- should be -1
Diffstat (limited to 'Lib')
-rw-r--r--Lib/StringIO.py4
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))