Commit b8f50552 authored by Frank Patz-Brockmann's avatar Frank Patz-Brockmann

Potential fix for https://github.com/buildout/buildout/issues/217

On Windows, `sys.prefix` is a site-package directory, i.e. for a
standard installation `C:\Python27`. The code path for `not
allow_site_packages` removed *everything* from `sys.path` that contains
*any* of the the site-packages directories as reported by
 `site.getsitepackages`, which on Windows removes all pathes below
 `sys.prefix` from `sys.path`.
parent 380ae506
...@@ -87,6 +87,10 @@ if not options.allow_site_packages: ...@@ -87,6 +87,10 @@ if not options.allow_site_packages:
# We can't remove these reliably # We can't remove these reliably
if hasattr(site, 'getsitepackages'): if hasattr(site, 'getsitepackages'):
for sitepackage_path in site.getsitepackages(): for sitepackage_path in site.getsitepackages():
# Strip all site-packages directories from sys.path that
# are not sys.prefix; this is because on Windows
# sys.prefix is a site-package directory.
if sitepackage_path != sys.prefix:
sys.path[:] = [x for x in sys.path if sitepackage_path not in x] sys.path[:] = [x for x in sys.path if sitepackage_path not in x]
setup_args = dict(to_dir=tmpeggs, download_delay=0) setup_args = dict(to_dir=tmpeggs, download_delay=0)
......
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