From fd0d9ace552a4fce85abcc622bdec9dc27f8c57d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 14 Jun 2014 11:32:18 -0400 Subject: Subclass dict rather that wrap and proxy. --- pkg_resources.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg_resources.py b/pkg_resources.py index 796fd9c3..323b28c8 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1530,19 +1530,16 @@ class EmptyProvider(NullProvider): empty_provider = EmptyProvider() -class ZipManifests(object): - - def __init__(self): - self.known = dict() +class ZipManifests(dict): def __call__(self, path): path = os.path.normpath(path) stat = os.stat(path) - if path not in self.known or self.known[path][0] != stat.st_mtime: - self.known[path] = (stat.st_mtime, self.build_manifest(path)) + if path not in self or self[path][0] != stat.st_mtime: + self[path] = (stat.st_mtime, self.build_manifest(path)) - return self.known[path][1] + return self[path][1] def build_manifest(self, path): """ -- cgit v1.2.3