Kaydet (Commit) cacbdf62 authored tarafından Neil Schemenauer's avatar Neil Schemenauer

Make GzipFile an iterator. Closes bug #532621.

üst fbb556df
......@@ -351,6 +351,16 @@ class GzipFile:
for line in L:
self.write(line)
def __iter__(self):
return self
def next(self):
line = self.readline()
if line:
return line
else:
raise StopIteration
def _test():
# Act like gzip; with -d, act like gunzip.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment