Abstract base class for import loaders.
| 4 | |
| 5 | |
| 6 | class Loader(metaclass=abc.ABCMeta): |
| 7 | |
| 8 | """Abstract base class for import loaders.""" |
| 9 | |
| 10 | def create_module(self, spec): |
| 11 | """Return a module to initialize and into which to load. |
| 12 | |
| 13 | This method should raise ImportError if anything prevents it |
| 14 | from creating a new module. It may return None to indicate |
| 15 | that the spec should create the new module. |
| 16 | """ |
| 17 | # By default, defer to default semantics for the new module. |
| 18 | return None |
| 19 | |
| 20 | # We don't define exec_module() here since that would break |
| 21 | # hasattr checks we do to support backward compatibility. |
no outgoing calls
no test coverage detected
searching dependent graphs…