Import a module and return a reference to it or None on failure.
(self, module_name)
| 109 | _warn_on_extension_import = (os.name == 'posix' or support.Py_DEBUG) |
| 110 | |
| 111 | def _conditional_import_module(self, module_name): |
| 112 | """Import a module and return a reference to it or None on failure.""" |
| 113 | try: |
| 114 | return importlib.import_module(module_name) |
| 115 | except ModuleNotFoundError as error: |
| 116 | if self._warn_on_extension_import and module_name in builtin_hashes: |
| 117 | logging.getLogger(__name__).warning( |
| 118 | 'Did a C extension fail to compile? %s', |
| 119 | error, |
| 120 | exc_info=error, |
| 121 | ) |
| 122 | return None |
| 123 | |
| 124 | def __init__(self, *args, **kwargs): |
| 125 | algorithms = set() |
no test coverage detected