Commit Graph

4 Commits

Author SHA1 Message Date
Brett Cannon 6919427e94 Implement the PEP 302 protocol for get_filename() as
importlib.abc.ExecutionLoader. PyLoader now inherits from this ABC instead of
InspectLoader directly. Both PyLoader and PyPycLoader provide concrete
implementations of get_filename in terms of source_path and bytecode_path.
2009-07-20 04:23:48 +00:00
Brett Cannon 64ef00fa60 Importlib's documentation said that importlib.abc.PyLoader inherited from
importlib.abc.ResourceLoader, when in fact it did not. Fixed the ABC to inherit
as documented.

This doesn't introduce an backwards-incompatiblity as the code in PyLoader
already required the single method ResourceLoader defined as an abstract
method.
2009-07-20 03:19:18 +00:00
Benjamin Peterson c9c0f201fe convert old fail* assertions to assert* 2009-06-30 23:06:06 +00:00
Brett Cannon 2a922ed6ad Introduce importlib.abc. The module contains various ABCs related to imports
(mostly stuff specified by PEP 302). There are two ABCs, PyLoader and
PyPycLoader, which help with implementing source and source/bytecode loaders by
implementing load_module in terms of other methods. This removes a lot of
gritty details loaders typically have to worry about.
2009-03-09 03:35:50 +00:00