diff --git a/Doc/library/site.rst b/Doc/library/site.rst --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -38,6 +38,9 @@ Unix and Macintosh). For each of the di if it refers to an existing directory, and if so, adds it to ``sys.path`` and also inspects the newly added path for configuration files. +.. deprecated:: 3.4 + Support for the "site-python" directory will be removed in 3.5. + If a file named "pyvenv.cfg" exists one directory above sys.executable, sys.prefix and sys.exec_prefix are set to that directory and it is also checked for site-packages and site-python (sys.base_prefix and diff --git a/Lib/site.py b/Lib/site.py --- a/Lib/site.py +++ b/Lib/site.py @@ -326,6 +326,11 @@ def addsitepackages(known_paths, prefixe """Add site-packages (and possibly site-python) to sys.path""" for sitedir in getsitepackages(prefixes): if os.path.isdir(sitedir): + if "site-python" in sitedir: + import warnings + warnings.warn('"site-python" directories will not be ' + 'supported in 3.5 anymore', + DeprecationWarning) addsitedir(sitedir, known_paths) return known_paths