diff options
| -rwxr-xr-x | setuptools/command/easy_install.py | 5 | ||||
| -rw-r--r-- | setuptools/tests/test_easy_install.py | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index ea5cb028..0bd3ea45 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1347,6 +1347,11 @@ def get_site_dirs(): if site.ENABLE_USER_SITE: sitedirs.append(site.USER_SITE) + try: + sitedirs.extend(site.getsitepackages()) + except AttributeError: + pass + sitedirs = list(map(normalize_path, sitedirs)) return sitedirs diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 55b8b05a..b9f820d8 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -119,6 +119,10 @@ class TestEasyInstallTest: with pytest.raises(distutils.errors.DistutilsError): cmd.cant_write_to_target() + @mock.patch('site.getsitepackages', lambda: ['/setuptools/test/site-packages']) + def test_all_site_dirs(self): + assert '/setuptools/test/site-packages' in ei.get_site_dirs() + class TestPTHFileWriter: def test_add_from_cwd_site_sets_dirty(self): |
