summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/command/bdist_msi.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2012-02-10 04:20:53 (GMT)
committerÉric Araujo <merwok@netwok.org>2012-02-10 04:20:53 (GMT)
commit9f90a731eb9a09e9e2fc022800475ff22206ac01 (patch)
tree9d026480d581f750298603d300bc053e8fce745f /Lib/packaging/command/bdist_msi.py
parentea0b1edf45c5fa33163fa59f33849029cd58c9e1 (diff)
downloadcpython-9f90a731eb9a09e9e2fc022800475ff22206ac01.zip
cpython-9f90a731eb9a09e9e2fc022800475ff22206ac01.tar.gz
cpython-9f90a731eb9a09e9e2fc022800475ff22206ac01.tar.bz2
Use sys.version_info instead of sys.version in packaging.
The contents of this attribute are an implementation detail, as documented for #9442, so we should not parse it, to support non-CPython VMs with distutils2 in the future. Unfortunately, one use comes directly from PEP 345, so an edit will have to be agreed before fixing the code (see comment in p7g.markers). Other remaining uses are found in p7g.compiler and could be replaced by the platform module (which also parses sys.version, but then it wouldn’t be my fault :)
Diffstat (limited to 'Lib/packaging/command/bdist_msi.py')
-rw-r--r--Lib/packaging/command/bdist_msi.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/packaging/command/bdist_msi.py b/Lib/packaging/command/bdist_msi.py
index 4f8eca6..995eec5 100644
--- a/Lib/packaging/command/bdist_msi.py
+++ b/Lib/packaging/command/bdist_msi.py
@@ -7,9 +7,8 @@ import sys
import os
import msilib
-
-from sysconfig import get_python_version
from shutil import rmtree
+from sysconfig import get_python_version
from packaging.command.cmd import Command
from packaging.version import NormalizedVersion
from packaging.errors import PackagingOptionError
@@ -204,7 +203,7 @@ class bdist_msi(Command):
target_version = self.target_version
if not target_version:
assert self.skip_build, "Should have already checked this"
- target_version = sys.version[0:3]
+ target_version = '%s.%s' % sys.version_info[:2]
plat_specifier = ".%s-%s" % (self.plat_name, target_version)
build = self.get_finalized_command('build')
build.build_lib = os.path.join(build.build_base,