summaryrefslogtreecommitdiffstats
path: root/Lib/gzip.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-04-13 04:51:49 (GMT)
committerGitHub <noreply@github.com>2021-04-13 04:51:49 (GMT)
commitd2a8e69c2c605fbaa3656a5f99aa8d295f74c80e (patch)
tree1f9874eec667494b36e238bb416fb133450b0f64 /Lib/gzip.py
parentd9151cb45371836d39b6d53afb50c5bcd353c661 (diff)
downloadcpython-d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e.zip
cpython-d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e.tar.gz
cpython-d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e.tar.bz2
bpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353)
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r--Lib/gzip.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 0a8993b..9a4e0f9 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -398,6 +398,10 @@ class GzipFile(_compression.BaseStream):
self._check_not_closed()
return self._buffer.readline(size)
+ def __iter__(self):
+ self._check_not_closed()
+ return self._buffer.__iter__()
+
class _GzipReader(_compression.DecompressReader):
def __init__(self, fp):