summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2013-03-29 13:49:37 -0600
committerCarl Meyer <carl@oddbird.net>2013-03-29 13:49:37 -0600
commit0524ad3fade53b447369ed5aca21f925c8f3f523 (patch)
tree5044243cacf83194c0e48adef7a2009c5c62a51b /setup.py
parent391ec5a08582f9479366e38afb4cb0547c39f073 (diff)
downloaddjango-0524ad3fade53b447369ed5aca21f925c8f3f523.tar.gz
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.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index cb30445700..450e74aaf3 100644
--- a/setup.py
+++ b/setup.py
@@ -10,9 +10,12 @@ import sys
# still present in site-packages. See #18115.
overlay_warning = False
if "install" in sys.argv:
- # We have to try also with an explicit prefix of /usr/local in order to
- # catch Debian's custom user site-packages directory.
- for lib_path in get_python_lib(), get_python_lib(prefix="/usr/local"):
+ 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
+ # catch Debian's custom user site-packages directory.
+ 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"))
if os.path.exists(existing_path):
# We note the need for the warning here, but present it after the