summaryrefslogtreecommitdiffstats
path: root/Lib/StringIO.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/StringIO.py')
-rw-r--r--Lib/StringIO.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/StringIO.py b/Lib/StringIO.py
index 1e5f254..7d57d80 100644
--- a/Lib/StringIO.py
+++ b/Lib/StringIO.py
@@ -116,7 +116,7 @@ class StringIO:
_complain_ifclosed(self.closed)
return self.pos
- def read(self, n = -1):
+ def read(self, n=None):
"""Read at most size bytes from the file
(less if the read hits EOF before obtaining size bytes).
@@ -128,6 +128,8 @@ class StringIO:
if self.buflist:
self.buf += ''.join(self.buflist)
self.buflist = []
+ if n is None:
+ n = -1
if n < 0:
newpos = self.len
else: