aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarek <none@none>2009-09-09 01:34:00 +0200
committertarek <none@none>2009-09-09 01:34:00 +0200
commitefd119a512592c664043e9d66c2b311690bbe55b (patch)
tree879098896b782a89d299841e38f9bb74fcfcf6ac
parent03f3942553e39b62ae308784542eaf0b1427c0dd (diff)
downloadexternal_python_setuptools-efd119a512592c664043e9d66c2b311690bbe55b.tar.gz
external_python_setuptools-efd119a512592c664043e9d66c2b311690bbe55b.tar.bz2
external_python_setuptools-efd119a512592c664043e9d66c2b311690bbe55b.zip
don't user USER_SITE on py < 2.6
--HG-- branch : distribute extra : rebase_source : caefe0a6171f53554178be6599aac67c4569e730
-rw-r--r--distribute_setup.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/distribute_setup.py b/distribute_setup.py
index 8f67829e..a57fd2a8 100644
--- a/distribute_setup.py
+++ b/distribute_setup.py
@@ -13,7 +13,11 @@ the appropriate options to ``use_setuptools()``.
This file can also be run as a script to install or upgrade setuptools.
"""
-from site import USER_SITE
+try:
+ from site import USER_SITE
+except ImportError:
+ USER_SITE = None
+
import sys
import os
import time
@@ -199,7 +203,7 @@ def _under_prefix(location):
if len(args) > index:
top_dir = args[index+1]
return location.startswith(top_dir)
- elif option == '--user':
+ elif option == '--user' and USER_SITE is not None:
return location.startswith(USER_SITE)
return True