diff options
author | Barry Warsaw <barry@python.org> | 2018-01-15 15:07:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 15:07:11 -0800 |
commit | 5ec0feeeecc1617987ec6cdc6d62b916e718a5cf (patch) | |
tree | 158c8a278acd9a7d2de71553c22199aa9b5b6ec6 /Lib/importlib/abc.py | |
parent | 21102f0dc20cc347677191817c1b66e20ef7bf21 (diff) | |
download | cpython-git-5ec0feeeecc1617987ec6cdc6d62b916e718a5cf.tar.gz |
Implement the get_resource_reader() API for file system imports (#5168)
Diffstat (limited to 'Lib/importlib/abc.py')
-rw-r--r-- | Lib/importlib/abc.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index bbff7af588..d2f45093a4 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -342,7 +342,7 @@ class SourceLoader(_bootstrap_external.SourceLoader, ResourceLoader, ExecutionLo _register(SourceLoader, machinery.SourceFileLoader) -class ResourceReader: +class ResourceReader(metaclass=abc.ABCMeta): """Abstract base class to provide resource-reading support. @@ -383,3 +383,6 @@ class ResourceReader: def contents(self): """Return an iterator of strings over the contents of the package.""" return iter([]) + + +_register(ResourceReader, machinery.SourceFileLoader) |