mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Issue #5052: make Distutils compatible with 2.3 again.
This commit is contained in:
parent
b31a6d0949
commit
dda92f7f02
7 changed files with 185 additions and 38 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue