diff options
| -rw-r--r-- | pkg_resources/__init__.py | 6 | ||||
| -rw-r--r-- | pkg_resources/tests/test_pkg_resources.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 4d15086f..a50ad1ab 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -2056,19 +2056,19 @@ def find_on_path(importer, path_item, only=False): filtered = ( entry for entry in entries - if dist_factory(entry, only) + if dist_factory(path_item, entry, only) ) # scan for .egg and .egg-info in directory path_item_entries = _by_version_descending(filtered) for entry in path_item_entries: fullpath = os.path.join(path_item, entry) - factory = dist_factory(entry, only) + factory = dist_factory(path_item, entry, only) for dist in factory(fullpath): yield dist -def dist_factory(entry, only): +def dist_factory(path_item, entry, only): """Return a dist_factory for the given entry.""" lower = entry.lower() if lower.endswith('.egg-info'): diff --git a/pkg_resources/tests/test_pkg_resources.py b/pkg_resources/tests/test_pkg_resources.py index 1c66dec0..9991402c 100644 --- a/pkg_resources/tests/test_pkg_resources.py +++ b/pkg_resources/tests/test_pkg_resources.py @@ -335,7 +335,7 @@ def test_dist_info_is_not_dir(tmp_path, only): """Test path containing a file with dist-info extension.""" dist_info = tmp_path / 'foobar.dist-info' dist_info.touch() - assert not pkg_resources.dist_factory(str(dist_info), only) + assert not pkg_resources.dist_factory(None, str(dist_info), only) class TestDeepVersionLookupDistutils: |
