summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-02-11 11:10:36 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-02-11 11:10:36 (GMT)
commit885bdc4946890f4bb80557fab80c3874b2cc4d39 (patch)
treebe6280757afecfd1b41c886f651d6cafae384df1 /Lib/test
parenta9725f86a984f74e74f09c4808fc8f4b403728b2 (diff)
downloadcpython-885bdc4946890f4bb80557fab80c3874b2cc4d39.zip
cpython-885bdc4946890f4bb80557fab80c3874b2cc4d39.tar.gz
cpython-885bdc4946890f4bb80557fab80c3874b2cc4d39.tar.bz2
Issue #25985: sys.version_info is now used instead of sys.version
to format short Python version.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_importlib/test_windows.py2
-rw-r--r--Lib/test/test_site.py5
-rw-r--r--Lib/test/test_venv.py2
3 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py
index c893bcf..005b685 100644
--- a/Lib/test/test_importlib/test_windows.py
+++ b/Lib/test/test_importlib/test_windows.py
@@ -40,7 +40,7 @@ def setup_module(machinery, name, path=None):
else:
root = machinery.WindowsRegistryFinder.REGISTRY_KEY
key = root.format(fullname=name,
- sys_version=sys.version[:3])
+ sys_version='%d.%d' % sys.version_info[:2])
try:
with temp_module(name, "a = 1") as location:
subkey = CreateKey(HKEY_CURRENT_USER, key)
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 6615080..574e496 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -238,13 +238,14 @@ class HelperFunctionsTests(unittest.TestCase):
self.assertEqual(len(dirs), 2)
wanted = os.path.join('/Library',
sysconfig.get_config_var("PYTHONFRAMEWORK"),
- sys.version[:3],
+ '%d.%d' % sys.version_info[:2],
'site-packages')
self.assertEqual(dirs[1], wanted)
elif os.sep == '/':
# OS X non-framwework builds, Linux, FreeBSD, etc
self.assertEqual(len(dirs), 1)
- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+ wanted = os.path.join('xoxo', 'lib',
+ 'python%d.%d' % sys.version_info[:2],
'site-packages')
self.assertEqual(dirs[0], wanted)
else:
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 28b0f6c..f38f52df 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -51,7 +51,7 @@ class BaseTest(unittest.TestCase):
self.include = 'Include'
else:
self.bindir = 'bin'
- self.lib = ('lib', 'python%s' % sys.version[:3])
+ self.lib = ('lib', 'python%d.%d' % sys.version_info[:2])
self.include = 'include'
if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in os.environ:
executable = os.environ['__PYVENV_LAUNCHER__']