Issue #5052: make Distutils compatible with 2.3 again.

This commit is contained in:
Tarek Ziadé 2009-02-27 12:53:34 +00:00
parent b31a6d0949
commit dda92f7f02
7 changed files with 185 additions and 38 deletions

View file

@ -8,7 +8,6 @@ __revision__ = "$Id$"
import sys, os, string, re
from types import *
from site import USER_BASE
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_compiler, get_python_version
@ -17,6 +16,14 @@ from distutils.extension import Extension
from distutils.util import get_platform
from distutils import log
# this keeps compatibility from 2.3 to 2.5
if sys.version < "2.6":
USER_BASE = None
HAS_USER_SITE = False
else:
from site import USER_BASE
HAS_USER_SITE = True
if os.name == 'nt':
from distutils.msvccompiler import get_build_version
MSVC_VERSION = int(get_build_version())
@ -92,11 +99,14 @@ class build_ext (Command):
"list of SWIG command line options"),
('swig=', None,
"path to the SWIG executable"),
('user', None,
"add user include, library and rpath"),
]
boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user']
boolean_options = ['inplace', 'debug', 'force', 'swig-cpp']
if HAS_USER_SITE:
user_options.append(('user', None,
"add user include, library and rpath"))
boolean_options.append('user')
help_options = [
('help-compiler', None,