From: Martin Panter Date: Fri, 13 Jan 2017 10:38:09 +0000 (+0000) Subject: Issue #22980: Skip a sysconfig test if _ctypes is not available. X-Git-Tag: v3.6.1rc1~172^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52e29072e1e4dd247bebb571a360baa0e9b79e72;p=thirdparty%2FPython%2Fcpython.git Issue #22980: Skip a sysconfig test if _ctypes is not available. Extracted from revision a1daf2d289ad by Zachary Ware. --- diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index a23bf06af8fc..38306790e42f 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -5,7 +5,8 @@ import subprocess import shutil from copy import copy -from test.support import (run_unittest, TESTFN, unlink, check_warnings, +from test.support import (run_unittest, + import_module, TESTFN, unlink, check_warnings, captured_stdout, skip_unless_symlink, change_cwd) import sysconfig @@ -387,7 +388,8 @@ class TestSysConfig(unittest.TestCase): @unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test') def test_triplet_in_ext_suffix(self): - import ctypes, platform, re + ctypes = import_module('ctypes') + import platform, re machine = platform.machine() suffix = sysconfig.get_config_var('EXT_SUFFIX') if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):