summaryrefslogtreecommitdiffstats
path: root/Lib/lzma.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/lzma.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/lzma.py')
-rw-r--r--Lib/lzma.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/lzma.py b/Lib/lzma.py
index c8b1970..2ada7d8 100644
--- a/Lib/lzma.py
+++ b/Lib/lzma.py
@@ -221,6 +221,10 @@ class LZMAFile(_compression.BaseStream):
self._check_can_read()
return self._buffer.readline(size)
+ def __iter__(self):
+ self._check_can_read()
+ return self._buffer.__iter__()
+
def write(self, data):
"""Write a bytes object to the file.