diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-05-10 15:51:53 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-05-10 15:52:50 -0400 |
| commit | fdee8026f5d58ee7cee0fad3c0b7e0ae7d5272ba (patch) | |
| tree | d0fd461b9786bd92e54d334fb72a3a5c87ef16bf /pkg_resources | |
| parent | d11428b1cc059ff6aa0ddec0bd8354a1df68d752 (diff) | |
| download | python-setuptools-git-fdee8026f5d58ee7cee0fad3c0b7e0ae7d5272ba.tar.gz | |
Restore parameter
Diffstat (limited to 'pkg_resources')
| -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: |
