summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-01-20 21:34:25 -0500
committerJason R. Coombs <jaraco@jaraco.com>2019-01-20 21:34:25 -0500
commit36a6a8bcf4b803f16891a766e87aabca3ace09e9 (patch)
treea5329be4d29e59178faa447cff795f11ab2d282f
parent1b935caf64fc8f3eb72c7ee8c05a221f7ca9d9b7 (diff)
downloadpython-setuptools-git-36a6a8bcf4b803f16891a766e87aabca3ace09e9.tar.gz
Remove usage relying on deprecated and ambiguous leading slash. Ref #1635
-rw-r--r--pkg_resources/__init__.py2
-rw-r--r--pkg_resources/tests/test_pkg_resources.py2
2 files changed, 1 insertions, 3 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 37222720..b30392fa 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -1932,7 +1932,7 @@ def find_eggs_in_zip(importer, path_item, only=False):
if only:
# don't yield nested distros
return
- for subitem in metadata.resource_listdir('/'):
+ for subitem in metadata.resource_listdir(''):
if _is_egg_path(subitem):
subpath = os.path.join(path_item, subitem)
dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath)
diff --git a/pkg_resources/tests/test_pkg_resources.py b/pkg_resources/tests/test_pkg_resources.py
index 416f9aff..2c2c9c7f 100644
--- a/pkg_resources/tests/test_pkg_resources.py
+++ b/pkg_resources/tests/test_pkg_resources.py
@@ -93,7 +93,6 @@ class TestZipProvider:
expected_root = ['data.dat', 'mod.py', 'subdir']
assert sorted(zp.resource_listdir('')) == expected_root
- assert sorted(zp.resource_listdir('/')) == expected_root
expected_subdir = ['data2.dat', 'mod2.py']
assert sorted(zp.resource_listdir('subdir')) == expected_subdir
@@ -106,7 +105,6 @@ class TestZipProvider:
zp2 = pkg_resources.ZipProvider(mod2)
assert sorted(zp2.resource_listdir('')) == expected_subdir
- assert sorted(zp2.resource_listdir('/')) == expected_subdir
assert zp2.resource_listdir('subdir') == []
assert zp2.resource_listdir('subdir/') == []