Arghh, checked in wrong draft. Replacing with correct one.

This commit is contained in:
Raymond Hettinger 2004-09-23 07:00:47 +00:00
parent 0336e1fe8c
commit 513c8bd6f2
1 changed files with 4 additions and 3 deletions

View File

@ -219,7 +219,7 @@ class StringIO:
slen = self.len
if spos == slen:
self.buflist.append(s)
self.len = self.pos = slen = spos = spos + len(s)
self.len = self.pos = spos + len(s)
return
if spos > slen:
self.buflist.append('\0'*(spos - slen))
@ -231,10 +231,11 @@ class StringIO:
self.buflist = [self.buf[:spos], s, self.buf[newpos:]]
self.buf = ''
if newpos > slen:
self.len = newpos
slen = newpos
else:
self.buflist.append(s)
self.len = newpos
slen = newpos
self.len = slen
self.pos = newpos
def writelines(self, iterable):