Commit 9ff9a0d6 authored by Jason R. Coombs's avatar Jason R. Coombs

Create a NoDists factory for returning no dists, whose boolean value is False.

parent eea94d01
......@@ -2045,12 +2045,29 @@ def find_on_path(importer, path_item, only=False):
if not only and _is_egg_path(entry) else
resolve_egg_link(fullpath)
if not only and lower.endswith('.egg-link') else
()
NoDists()(fullpath)
)
for dist in dists:
yield dist
class NoDists:
"""
>>> bool(NoDists())
False
>>> list(NoDists()('anything'))
[]
"""
def __bool__(self):
return False
if six.PY2:
__nonzero__ = __bool__
def __call__(self, fullpath):
return iter(())
def safe_listdir(path):
"""
Attempt to list contents of path, but suppress some exceptions.
......
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