summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap_external.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-03-04 18:43:00 (GMT)
committerGitHub <noreply@github.com>2021-03-04 18:43:00 (GMT)
commit67148254146948041a77d8a2989f41b88cdb2f99 (patch)
tree036bcb818e80090b34f0c59f57f8b6946b52b21d /Lib/importlib/_bootstrap_external.py
parentfbf75b9997e280b1220755d0a17dbed71240d42e (diff)
downloadcpython-67148254146948041a77d8a2989f41b88cdb2f99.zip
cpython-67148254146948041a77d8a2989f41b88cdb2f99.tar.gz
cpython-67148254146948041a77d8a2989f41b88cdb2f99.tar.bz2
bpo-42129: Add support for resources in namespaces (GH-24670)
* Unify behavior in ResourceReaderDefaultsTests and align with the behavior found in importlib_resources. * Equip NamespaceLoader with a NamespaceReader. * Apply changes from importlib_resources 5.0.4
Diffstat (limited to 'Lib/importlib/_bootstrap_external.py')
-rw-r--r--Lib/importlib/_bootstrap_external.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 3396d5d..2dab45d 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -1259,6 +1259,10 @@ class _NamespaceLoader:
# Warning implemented in _load_module_shim().
return _bootstrap._load_module_shim(self, fullname)
+ def get_resource_reader(self, module):
+ from importlib.readers import NamespaceReader
+ return NamespaceReader(self._path)
+
# Finders #####################################################################