Commit 2c729473 authored by Jason R. Coombs's avatar Jason R. Coombs

Use a namedtuple to avoid numeric indexes

parent 7b7c55a2
......@@ -29,6 +29,7 @@ import token
import symbol
import operator
import platform
import collections
from pkgutil import get_importer
try:
......@@ -1534,6 +1535,7 @@ class ZipManifests(dict):
"""
Memoized zipfile manifests.
"""
manifest_mod = collections.namedtuple('manifest_mod', 'manifest mtime')
def load(self, path):
"""
......@@ -1542,10 +1544,11 @@ class ZipManifests(dict):
path = os.path.normpath(path)
mtime = os.stat(path).st_mtime
if path not in self or self[path][0] != mtime:
self[path] = (mtime, self.build(path))
if path not in self or self[path].mtime != mtime:
manifest = self.build(path)
self[path] = self.manifest_mod(manifest, mtime)
return self[path][1]
return self[path].manifest
@classmethod
def build(cls, path):
......
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