mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
fix default arg for read() -- should be -1
This commit is contained in:
parent
06d74418e5
commit
f7476c5088
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue