Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cace1a

Browse files
committed
[Bug #550364] Use sysconfig.get_python_version()
1 parent 0ff98b9 commit 1cace1a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/distutils/command/bdist_wininst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def finalize_options (self):
7070
if not self.target_version:
7171
self.target_version = ""
7272
if self.distribution.has_ext_modules():
73-
short_version = sys.version[:3]
73+
short_version = get_python_version()
7474
if self.target_version and self.target_version != short_version:
7575
raise DistutilsOptionError, \
7676
"target version can only be" + short_version

Lib/distutils/command/build_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from types import *
1313
from distutils.core import Command
1414
from distutils.errors import *
15-
from distutils.sysconfig import customize_compiler
15+
from distutils.sysconfig import customize_compiler, get_python_version
1616
from distutils.dep_util import newer_group
1717
from distutils.extension import Extension
1818
from distutils import log
@@ -184,7 +184,7 @@ def finalize_options (self):
184184
if string.find(sys.executable, sys.exec_prefix) != -1:
185185
# building third party extensions
186186
self.library_dirs.append(os.path.join(sys.prefix, "lib",
187-
"python" + sys.version[:3],
187+
"python" + get_python_version(),
188188
"config"))
189189
else:
190190
# building python standard extensions

0 commit comments

Comments
 (0)