Commits

Arfrever Frehtes Taifersar Arahesis committed 86cf3de

Issue #341: Fix a ResourceWarning.

Comments (0)

Files changed (2)

 * Fix issue in pkg_resources where try/except around a platform-dependent
   import would trigger hook load failures on Mercurial. See pull request 32
   for details.
+* Issue #341: Fix a ResourceWarning.
 
 ------
 0.6.32
                     for dist in find_distributions(os.path.join(path_item, entry)):
                         yield dist
                 elif not only and lower.endswith('.egg-link'):
-                    for line in open(os.path.join(path_item, entry)):
+                    entry_file = open(os.path.join(path_item, entry))
+                    for line in entry_file:
                         if not line.strip(): continue
                         for item in find_distributions(os.path.join(path_item,line.rstrip())):
                             yield item
                         break
+                    entry_file.close()
 register_finder(ImpWrapper,find_on_path)
 
 if importlib_bootstrap is not None: