Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(28036)

Unified Diff: Lib/test/test_sysconfig.py

Issue 22980: C extension naming doesn't take bitness into account
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « configure.ac ('k') | Misc/NEWS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_sysconfig.py Mon Apr 13 22:11:34 2015 +0200
+++ b/Lib/test/test_sysconfig.py Wed Apr 15 02:44:28 2015 +0200
@@ -390,10 +390,19 @@
self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
@unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test')
- def test_bitness_in_ext_suffix(self):
+ def test_triplet_in_ext_suffix(self):
+ import ctypes, platform, re
+ machine = platform.machine()
suffix = sysconfig.get_config_var('EXT_SUFFIX')
- bitness = '-32b' if sys.maxsize < 2**32 else '-64b'
- self.assertTrue(suffix.endswith(bitness + '.so'), suffix)
+ if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):
+ self.assertTrue('linux' in suffix, suffix)
+ if re.match('(i[3-6]86|x86_64)$', 'x86_64'):
+ if ctypes.sizeof(ctypes.c_char_p()) == 4:
+ self.assertTrue(suffix.endswith('i386-linux-gnu.so') \
+ or suffix.endswith('x86_64-linux-gnux32.so'),
+ suffix)
+ else: # 8 byte pointer size
+ self.assertTrue(suffix.endswith('x86_64-linux-gnu.so'), suffix)
class MakefileTests(unittest.TestCase):
« no previous file with comments | « configure.ac ('k') | Misc/NEWS » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+