diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2014-06-14 12:07:27 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-06-14 12:07:27 -0400 |
| commit | 434df30acd39f412816773aca4a1d19e78a631be (patch) | |
| tree | 8c5a321e29ca3b88621ecf0649999fc33a447205 /pkg_resources.py | |
| parent | dfcbd73ce9160ae691910e088ae9013b22a4a78e (diff) | |
| download | python-setuptools-git-434df30acd39f412816773aca4a1d19e78a631be.tar.gz | |
Rewrite construct/append loop with simple iterator.
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index d12e9353..ca29ed66 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1569,13 +1569,15 @@ class ZipManifests(dict): zipinfo.date_time[4] << 5 | (zipinfo.date_time[5] // 2) * [7] - zipinfo.CRC """ - zipinfo = dict() with ContextualZipFile(path) as zfile: - for zitem in zfile.namelist(): - zpath = zitem.replace('/', os.sep) - zipinfo[zpath] = zfile.getinfo(zitem) - assert zipinfo[zpath] is not None - return zipinfo + items = ( + ( + name.replace('/', os.sep), + zfile.getinfo(name), + ) + for name in zfile.namelist() + ) + return dict(items) build_zipmanifest = ZipManifests() |
