# HG changeset patch -- Bitbucket.org # Project distutils2-fixes # URL https://bitbucket.org/pumazi/distutils2-fixes/overview # User pumazi # Date 1294721237 18000 # Node ID f3b5eb2aac2cbe74b6a27a7525facecd4f100348 # Parent 0de7d5f4dae5bc5cb8e2cbb48b96a4e5a8d659e8 Fixes an issue where path is overridden before reference in the follow up statement. The fix allows .egg-info metadata requirements to be recognized. As a result depgraph will then work on older .egg-info distributions. --- a/distutils2/_backport/pkgutil.py +++ b/distutils2/_backport/pkgutil.py @@ -901,12 +901,12 @@ class EggInfoDistribution(object): self.name = self.metadata['Name'] elif path.endswith('.egg-info'): if os.path.isdir(path): - path = os.path.join(path, 'PKG-INFO') try: req_f = open(os.path.join(path, 'requires.txt'), 'r') requires = req_f.read() except IOError: requires = None + path = os.path.join(path, 'PKG-INFO') self.metadata = DistributionMetadata(path=path) self.name = self.metadata['name'] else: