Philip Jenvey committed bb0df4c

reapply 2b05ce699b09 from default

  • Participants
  • Parent commits 5cfb417
  • Branches py3k

Comments (0)

Files changed (1)

File lib-python/3/test/

 from import (run_unittest, TESTFN, unlink, get_attribute,
                           captured_stdout, skip_unless_symlink,
-                          impl_detail)
+                          impl_detail, import_module)
 import sysconfig
 from sysconfig import (get_paths, get_platform, get_config_vars,
     def test_get_config_h_filename(self):
         config_h = sysconfig.get_config_h_filename()
-        self.assertTrue(os.path.isfile(config_h), config_h)
+        # import_module skips the test when the CPython C Extension API
+        # appears to not be supported
+        self.assertTrue(os.path.isfile(config_h) or
+                        not import_module('_testcapi'), config_h)
     def test_get_scheme_names(self):
         wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',