diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 09:10:35 (GMT) |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 09:10:35 (GMT) |
commit | ee5e61d3bc127c9d3c6ac752b2d381718da910ef (patch) | |
tree | af65794ead4be0e72339123db3ccf98f23f80bd8 /Lib/gzip.py | |
parent | 6b71e747b19c41e0665ee14eb755c924a40dd774 (diff) | |
download | cpython-ee5e61d3bc127c9d3c6ac752b2d381718da910ef.zip cpython-ee5e61d3bc127c9d3c6ac752b2d381718da910ef.tar.gz cpython-ee5e61d3bc127c9d3c6ac752b2d381718da910ef.tar.bz2 |
String method conversion.
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r-- | Lib/gzip.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index 53e6e9c..8e34ed2 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -5,7 +5,7 @@ but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module -import string, struct, sys, time +import struct, sys, time import zlib import __builtin__ @@ -138,7 +138,7 @@ class GzipFile: self.fileobj.write( self.compress.compress(data) ) def writelines(self,lines): - self.write(string.join(lines)) + self.write(" ".join(lines)) def read(self, size=-1): if self.extrasize <= 0 and self.fileobj is None: @@ -281,10 +281,10 @@ class GzipFile: readsize = min(100, size) # Read from the file in small chunks while 1: if size == 0: - return string.join(bufs, '') # Return resulting line + return "".join(bufs) # Return resulting line c = self.read(readsize) - i = string.find(c, '\n') + i = c.find('\n') if size is not None: # We set i=size to break out of the loop under two # conditions: 1) there's no newline, and the chunk is @@ -296,7 +296,7 @@ class GzipFile: if i >= 0 or c == '': bufs.append(c[:i+1]) # Add portion of last chunk self._unread(c[i+1:]) # Push back rest of chunk - return string.join(bufs, '') # Return resulting line + return ''.join(bufs) # Return resulting line # Append chunk to list, decrease 'size', bufs.append(c) |