(original) (raw)

Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v retrieving revision 1.45 diff -u -r1.45 sysconfig.py --- sysconfig.py 31 Jan 2002 18:55:33 -0000 1.45 +++ sysconfig.py 29 Apr 2002 15:37:03 -0000 @@ -38,6 +38,14 @@ python_build = 1 +def get_python_version (): + """Return a string containing the major and minor Python version, + leaving off the patchlevel. Sample return values could be '1.5' + or '2.2'. + """ + return sys.version[:3] + + def get_python_inc(plat_specific=0, prefix=None): """Return the directory containing installed Python header files. @@ -54,7 +62,7 @@ if os.name == "posix": if python_build: return "Include/" - return os.path.join(prefix, "include", "python" + sys.version[:3]) + return os.path.join(prefix, "include", "python" + get_python_version()) elif os.name == "nt": return os.path.join(prefix, "include") elif os.name == "mac": @@ -86,7 +94,7 @@ if os.name == "posix": libpython = os.path.join(prefix, - "lib", "python" + sys.version[:3]) + "lib", "python" + get_python_version()) if standard_lib: return libpython else: Index: command/bdist_wininst.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_wininst.py,v retrieving revision 1.31 diff -u -r1.31 bdist_wininst.py --- command/bdist_wininst.py 9 Apr 2002 14:14:38 -0000 1.31 +++ command/bdist_wininst.py 29 Apr 2002 15:37:04 -0000 @@ -12,6 +12,7 @@ from distutils.util import get_platform from distutils.dir_util import create_tree, remove_tree from distutils.errors import * +from distutils.sysconfig import get_python_version class bdist_wininst (Command): @@ -68,7 +69,7 @@ if not self.target_version: self.target_version = "" if self.distribution.has_ext_modules(): - short_version = sys.version[:3] + short_version = get_python_version() if self.target_version and self.target_version != short_version: raise DistutilsOptionError, \ "target version can only be" + short_version Index: command/build_ext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_ext.py,v retrieving revision 1.80 diff -u -r1.80 build_ext.py --- command/build_ext.py 25 Apr 2002 17:26:37 -0000 1.80 +++ command/build_ext.py 29 Apr 2002 15:37:04 -0000 @@ -12,7 +12,7 @@ from types import * from distutils.core import Command from distutils.errors import * -from distutils.sysconfig import customize_compiler +from distutils.sysconfig import customize_compiler, get_python_version from distutils.dep_util import newer_group from distutils.extension import Extension @@ -183,7 +183,7 @@ if string.find(sys.executable, sys.exec_prefix) != -1: # building third party extensions self.library_dirs.append(os.path.join(sys.prefix, "lib", - "python" + sys.version[:3], + "python" + get_python_version(), "config")) else: # building python standard extensions