diff options
author | Greg Ward <gward@python.net> | 2001-08-23 20:53:27 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2001-08-23 20:53:27 (GMT) |
commit | f17efb93d95562071b6069e44b723873ffba05f4 (patch) | |
tree | 6a36d1e1eec193cf00545c4dffc09226f6adf9be | |
parent | 971e0690c4ae81da3d86df82c2aef5872beb3ca3 (diff) | |
download | cpython-f17efb93d95562071b6069e44b723873ffba05f4.zip cpython-f17efb93d95562071b6069e44b723873ffba05f4.tar.gz cpython-f17efb93d95562071b6069e44b723873ffba05f4.tar.bz2 |
Patch #449054 to implement PEP 250. The standard install directory for
modules and extensions on Windows is now $PREFIX/Lib/site-packages.
Includes backwards compatibility code for pre-2.2 Pythons. Contributed
by Paul Moore.
-rw-r--r-- | Lib/distutils/command/install.py | 25 | ||||
-rw-r--r-- | Lib/distutils/sysconfig.py | 5 |
2 files changed, 22 insertions, 8 deletions
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index 1d0a34e..5af4cf1 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -16,6 +16,23 @@ from distutils.util import convert_path, subst_vars, change_root from distutils.errors import DistutilsOptionError from glob import glob +if sys.version < "2.2": + WINDOWS_SCHEME = { + 'purelib': '$base', + 'platlib': '$base', + 'headers': '$base/Include/$dist_name', + 'scripts': '$base/Scripts', + 'data' : '$base', + } +else: + WINDOWS_SCHEME = { + 'purelib': '$base/Lib/site-packages', + 'platlib': '$base/Lib/site-packages', + 'headers': '$base/Include/$dist_name', + 'scripts': '$base/Scripts', + 'data' : '$base', + } + INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', @@ -31,13 +48,7 @@ INSTALL_SCHEMES = { 'scripts': '$base/bin', 'data' : '$base', }, - 'nt': { - 'purelib': '$base', - 'platlib': '$base', - 'headers': '$base/Include/$dist_name', - 'scripts': '$base/Scripts', - 'data' : '$base', - }, + 'nt': WINDOWS_SCHEME, 'mac': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 1f0d145..558ff29 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -94,7 +94,10 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): if standard_lib: return os.path.join(prefix, "Lib") else: - return prefix + if sys.version < "2.2": + return prefix + else: + return os.path.join(PREFIX, "Lib", "site-packages") elif os.name == "mac": if plat_specific: |