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