summaryrefslogtreecommitdiff
path: root/Lib/gzip.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r--Lib/gzip.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 74c0d26a06..9e9f5d4b1f 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -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.