summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-04-10 01:17:49 (GMT)
committerGreg Ward <gward@python.net>2000-04-10 01:17:49 (GMT)
commitd38e6f763797bec120ba110cd6e416d903c071b9 (patch)
tree1eb488aee26af806936d44285fe71f051e439c9e /Lib
parentcf6bea3dc70977e424ac6b5f1d48b0c1a4dbf186 (diff)
downloadcpython-d38e6f763797bec120ba110cd6e416d903c071b9.zip
cpython-d38e6f763797bec120ba110cd6e416d903c071b9.tar.gz
cpython-d38e6f763797bec120ba110cd6e416d903c071b9.tar.bz2
Added optional 'prefix' arguments to 'get_python_inc()' and
'get_python_lib()'.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/sysconfig.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 9cf9540..3f345fb 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -20,7 +20,7 @@ PREFIX = os.path.normpath(sys.prefix)
EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
-def get_python_inc(plat_specific=0):
+def get_python_inc(plat_specific=0, prefix=None):
"""Return the directory containing installed Python header files.
If 'plat_specific' is false (the default), this is the path to the
@@ -28,8 +28,11 @@ def get_python_inc(plat_specific=0):
otherwise, this is the path to platform-specific header files
(namely config.h).
+ If 'prefix' is supplied, use it instead of sys.prefix or
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
"""
- prefix = (plat_specific and EXEC_PREFIX or PREFIX)
+ if prefix is None:
+ prefix = (plat_specific and EXEC_PREFIX or PREFIX)
if os.name == "posix":
return os.path.join(prefix, "include", "python" + sys.version[:3])
elif os.name == "nt":
@@ -42,7 +45,7 @@ def get_python_inc(plat_specific=0):
"on platform '%s'") % os.name
-def get_python_lib(plat_specific=0, standard_lib=0):
+def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
"""Return the directory containing the Python library (standard or
site additions).
@@ -53,8 +56,11 @@ def get_python_lib(plat_specific=0, standard_lib=0):
containing standard Python library modules; otherwise, return the
directory for site-specific modules.
+ If 'prefix' is supplied, use it instead of sys.prefix or
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
"""
- prefix = (plat_specific and EXEC_PREFIX or PREFIX)
+ if prefix is None:
+ prefix = (plat_specific and EXEC_PREFIX or PREFIX)
if os.name == "posix":
libpython = os.path.join(prefix,