Commit 434df30a authored by Jason R. Coombs's avatar Jason R. Coombs

Rewrite construct/append loop with simple iterator.

parent dfcbd73c
...@@ -1569,13 +1569,15 @@ class ZipManifests(dict): ...@@ -1569,13 +1569,15 @@ class ZipManifests(dict):
zipinfo.date_time[4] << 5 | (zipinfo.date_time[5] // 2) zipinfo.date_time[4] << 5 | (zipinfo.date_time[5] // 2)
* [7] - zipinfo.CRC * [7] - zipinfo.CRC
""" """
zipinfo = dict()
with ContextualZipFile(path) as zfile: with ContextualZipFile(path) as zfile:
for zitem in zfile.namelist(): items = (
zpath = zitem.replace('/', os.sep) (
zipinfo[zpath] = zfile.getinfo(zitem) name.replace('/', os.sep),
assert zipinfo[zpath] is not None zfile.getinfo(name),
return zipinfo )
for name in zfile.namelist()
)
return dict(items)
build_zipmanifest = ZipManifests() build_zipmanifest = ZipManifests()
......
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