From f17efb93d95562071b6069e44b723873ffba05f4 Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Thu, 23 Aug 2001 20:53:27 +0000 Subject: 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. --- Lib/distutils/command/install.py | 25 ++++++++++++++++++------- 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: -- cgit v0.12