Fixed setup.py overlaid-install warning.
Before this change, if you had a global Django installation in /usr/local/, you might get a spurious warning when installing Django within a virtualenv. Thanks epicserve for the report and debugging help.
This commit is contained in:
parent
391ec5a085
commit
0524ad3fad
5
setup.py
5
setup.py
|
@ -10,9 +10,12 @@ import sys
|
||||||
# still present in site-packages. See #18115.
|
# still present in site-packages. See #18115.
|
||||||
overlay_warning = False
|
overlay_warning = False
|
||||||
if "install" in sys.argv:
|
if "install" in sys.argv:
|
||||||
|
lib_paths = [get_python_lib()]
|
||||||
|
if lib_paths[0].startswith("/usr/lib/"):
|
||||||
# We have to try also with an explicit prefix of /usr/local in order to
|
# We have to try also with an explicit prefix of /usr/local in order to
|
||||||
# catch Debian's custom user site-packages directory.
|
# catch Debian's custom user site-packages directory.
|
||||||
for lib_path in get_python_lib(), get_python_lib(prefix="/usr/local"):
|
lib_paths.append(get_python_lib(prefix="/usr/local"))
|
||||||
|
for lib_path in lib_paths:
|
||||||
existing_path = os.path.abspath(os.path.join(lib_path, "django"))
|
existing_path = os.path.abspath(os.path.join(lib_path, "django"))
|
||||||
if os.path.exists(existing_path):
|
if os.path.exists(existing_path):
|
||||||
# We note the need for the warning here, but present it after the
|
# We note the need for the warning here, but present it after the
|
||||||
|
|
Loading…
Reference in New Issue