subset of importlib abc used to reduce importlib util imports from import bootstrap import abc class loadermetaclassabc abcmeta return a module to initialize and into which to load this method should raise importerror if anything prevents it from creating a new module it may return none to indicate that the spec should create the new module by default defer to default semantics for the new module we don t define execmodule here since that would break hasattr checks we do to support backward compatibility return the loaded module the module must be added to sys modules and have importrelated attributes set properly the fullname is a str importerror is raised on failure this method is deprecated in favor of loader execmodule if execmodule exists then it is used to provide a backwardscompatible functionality for this method warning implemented in loadmoduleshim abstract base class for import loaders return a module to initialize and into which to load this method should raise importerror if anything prevents it from creating a new module it may return none to indicate that the spec should create the new module by default defer to default semantics for the new module we don t define exec_module here since that would break hasattr checks we do to support backward compatibility return the loaded module the module must be added to sys modules and have import related attributes set properly the fullname is a str importerror is raised on failure this method is deprecated in favor of loader exec_module if exec_module exists then it is used to provide a backwards compatible functionality for this method warning implemented in _load_module_shim
from . import _bootstrap
import abc

class Loader(metaclass=abc.ABCMeta):

    def create_module(self, spec):

        return None

    
    def load_module(self, fullname):
        
        if not hasattr(self, 'exec_module'):
            raise ImportError
        
        return _bootstrap._load_module_shim(self, fullname)