Commit d73c8722 authored by Tres Seaver's avatar Tres Seaver

Harden fix for issue #341 against exceptins.

--HG--
branch : distribute
extra : rebase_source : 5cb7f22523a741e678b03a699f0ef09f09ed8070
parent 721559fe
...@@ -1762,12 +1762,14 @@ def find_on_path(importer, path_item, only=False): ...@@ -1762,12 +1762,14 @@ def find_on_path(importer, path_item, only=False):
yield dist yield dist
elif not only and lower.endswith('.egg-link'): elif not only and lower.endswith('.egg-link'):
entry_file = open(os.path.join(path_item, entry)) entry_file = open(os.path.join(path_item, entry))
for line in entry_file: try:
if not line.strip(): continue for line in entry_file:
for item in find_distributions(os.path.join(path_item,line.rstrip())): if not line.strip(): continue
yield item for item in find_distributions(os.path.join(path_item,line.rstrip())):
break yield item
entry_file.close() break
finally:
entry_file.close()
register_finder(ImpWrapper,find_on_path) register_finder(ImpWrapper,find_on_path)
if importlib_bootstrap is not None: if importlib_bootstrap is not None:
......
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