diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2024-08-13 20:44:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-13 20:44:57 (GMT) |
commit | ee1b8ce26e700350e47a5f65201097121c41912e (patch) | |
tree | d20c7875e496ceca4c74a706f5536774e0fc0dd6 /Tools/build | |
parent | 5f6851152254b4b9d70af4ae5aea3f20965cee28 (diff) | |
download | cpython-ee1b8ce26e700350e47a5f65201097121c41912e.zip cpython-ee1b8ce26e700350e47a5f65201097121c41912e.tar.gz cpython-ee1b8ce26e700350e47a5f65201097121c41912e.tar.bz2 |
gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)
As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working. This is a minimal fix just to get builds working again. There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.
Diffstat (limited to 'Tools/build')
-rw-r--r-- | Tools/build/check_extension_modules.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tools/build/check_extension_modules.py b/Tools/build/check_extension_modules.py index a9fee49..cef97a4 100644 --- a/Tools/build/check_extension_modules.py +++ b/Tools/build/check_extension_modules.py @@ -27,6 +27,7 @@ import re import sys import sysconfig import warnings +import _imp from importlib._bootstrap import _load as bootstrap_load from importlib.machinery import BuiltinImporter, ExtensionFileLoader, ModuleSpec @@ -153,6 +154,11 @@ class ModuleChecker: self.notavailable = [] def check(self): + if not hasattr(_imp, 'create_dynamic'): + logger.warning( + ('Dynamic extensions not supported ' + '(HAVE_DYNAMIC_LOADING not defined)'), + ) for modinfo in self.modules: logger.debug("Checking '%s' (%s)", modinfo.name, self.get_location(modinfo)) if modinfo.state == ModuleState.DISABLED: @@ -414,6 +420,9 @@ class ModuleChecker: logger.error("%s failed to import: %s", modinfo.name, e) raise except Exception as e: + if not hasattr(_imp, 'create_dynamic'): + logger.warning("Dynamic extension '%s' ignored", modinfo.name) + return logger.exception("Importing extension '%s' failed!", modinfo.name) raise |