55
66# based on Andrew Kuchling's minigzip.py distributed with the zlib module
77
8- import string , struct , sys , time
8+ import struct , sys , time
99import zlib
1010import __builtin__
1111
@@ -138,7 +138,7 @@ def write(self,data):
138138 self .fileobj .write ( self .compress .compress (data ) )
139139
140140 def writelines (self ,lines ):
141- self .write (string .join (lines ))
141+ self .write (" " .join (lines ))
142142
143143 def read (self , size = - 1 ):
144144 if self .extrasize <= 0 and self .fileobj is None :
@@ -281,10 +281,10 @@ def readline(self, size=-1):
281281 readsize = min (100 , size ) # Read from the file in small chunks
282282 while 1 :
283283 if size == 0 :
284- return string .join (bufs , '' ) # Return resulting line
284+ return "" .join (bufs ) # Return resulting line
285285
286286 c = self .read (readsize )
287- i = string .find (c , '\n ' )
287+ i = c .find ('\n ' )
288288 if size is not None :
289289 # We set i=size to break out of the loop under two
290290 # conditions: 1) there's no newline, and the chunk is
@@ -296,7 +296,7 @@ def readline(self, size=-1):
296296 if i >= 0 or c == '' :
297297 bufs .append (c [:i + 1 ]) # Add portion of last chunk
298298 self ._unread (c [i + 1 :]) # Push back rest of chunk
299- return string .join (bufs , '' ) # Return resulting line
299+ return '' .join (bufs ) # Return resulting line
300300
301301 # Append chunk to list, decrease 'size',
302302 bufs .append (c )
0 commit comments