summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2014-12-16 04:45:23 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2014-12-16 04:45:23 (GMT)
commit03a144bb6ac3d7631a3bdb895e2a1f2d021fb08b (patch)
tree3ecded55448b2078f717dc5c0edb2e4c62510073 /Lib
parent09bd9ec9b3c563915b6428459032de6cda6c1336 (diff)
downloadcpython-03a144bb6ac3d7631a3bdb895e2a1f2d021fb08b.zip
cpython-03a144bb6ac3d7631a3bdb895e2a1f2d021fb08b.tar.gz
cpython-03a144bb6ac3d7631a3bdb895e2a1f2d021fb08b.tar.bz2
#22980 Adds platform and version tags to .pyd files
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_importlib/test_windows.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py
index 46e23be..c893bcf 100644
--- a/Lib/test/test_importlib/test_windows.py
+++ b/Lib/test/test_importlib/test_windows.py
@@ -2,9 +2,11 @@ from . import util as test_util
machinery = test_util.import_importlib('importlib.machinery')
import os
+import re
import sys
import unittest
from test import support
+from distutils.util import get_platform
from contextlib import contextmanager
from .util import temp_module
@@ -83,3 +85,25 @@ class WindowsRegistryFinderTests:
(Frozen_WindowsRegistryFinderTests,
Source_WindowsRegistryFinderTests
) = test_util.test_both(WindowsRegistryFinderTests, machinery=machinery)
+
+@unittest.skipUnless(sys.platform.startswith('win'), 'requires Windows')
+class WindowsExtensionSuffixTests:
+ def test_tagged_suffix(self):
+ suffixes = self.machinery.EXTENSION_SUFFIXES
+ expected_tag = ".cp{0.major}{0.minor}-{1}.pyd".format(sys.version_info,
+ re.sub('[^a-zA-Z0-9]', '_', get_platform()))
+ try:
+ untagged_i = suffixes.index(".pyd")
+ except ValueError:
+ untagged_i = suffixes.index("_d.pyd")
+ expected_tag = "_d" + expected_tag
+
+ self.assertIn(expected_tag, suffixes)
+
+ # Ensure the tags are in the correct order
+ tagged_i = suffixes.index(expected_tag)
+ self.assertLess(tagged_i, untagged_i)
+
+(Frozen_WindowsExtensionSuffixTests,
+ Source_WindowsExtensionSuffixTests
+ ) = test_util.test_both(WindowsExtensionSuffixTests, machinery=machinery)