mirror of https://github.com/python/cpython.git
[Bug #550364] Use sysconfig.get_python_version()
This commit is contained in:
parent
0ff98b9346
commit
1cace1a30a
|
@ -70,7 +70,7 @@ def finalize_options (self):
|
||||||
if not self.target_version:
|
if not self.target_version:
|
||||||
self.target_version = ""
|
self.target_version = ""
|
||||||
if self.distribution.has_ext_modules():
|
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:
|
if self.target_version and self.target_version != short_version:
|
||||||
raise DistutilsOptionError, \
|
raise DistutilsOptionError, \
|
||||||
"target version can only be" + short_version
|
"target version can only be" + short_version
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
from types import *
|
from types import *
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils.errors import *
|
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.dep_util import newer_group
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
@ -184,7 +184,7 @@ def finalize_options (self):
|
||||||
if string.find(sys.executable, sys.exec_prefix) != -1:
|
if string.find(sys.executable, sys.exec_prefix) != -1:
|
||||||
# building third party extensions
|
# building third party extensions
|
||||||
self.library_dirs.append(os.path.join(sys.prefix, "lib",
|
self.library_dirs.append(os.path.join(sys.prefix, "lib",
|
||||||
"python" + sys.version[:3],
|
"python" + get_python_version(),
|
||||||
"config"))
|
"config"))
|
||||||
else:
|
else:
|
||||||
# building python standard extensions
|
# building python standard extensions
|
||||||
|
|
Loading…
Reference in New Issue