diff options
author | Barry Warsaw <barry@python.org> | 2021-10-20 14:05:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 14:05:29 -0700 |
commit | 876fc7fcec9a79a11546b7588d3683a5ccb4d31c (patch) | |
tree | 9195e6474ea19461bbc5d9705f05bd2cf8603209 /Lib/importlib/_bootstrap.py | |
parent | 6270d3eeaf17b50abc4f8f4d97790d66179638e4 (diff) | |
download | cpython-876fc7fcec9a79a11546b7588d3683a5ccb4d31c.tar.gz cpython-876fc7fcec9a79a11546b7588d3683a5ccb4d31c.zip |
bpo-35673: Add a public alias for namespace package __loader__ attribute (#29049)
Rename namespace package __loader__ class to be public.
Make the old name, i.e. _NamespaceLoader, an alias for the public name, for backward compatibility.
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 889f08f8aee..afb95f4e1df 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -507,9 +507,9 @@ def _init_module_attrs(spec, module, *, override=False): if spec.submodule_search_locations is not None: if _bootstrap_external is None: raise NotImplementedError - _NamespaceLoader = _bootstrap_external._NamespaceLoader + NamespaceLoader = _bootstrap_external.NamespaceLoader - loader = _NamespaceLoader.__new__(_NamespaceLoader) + loader = NamespaceLoader.__new__(NamespaceLoader) loader._path = spec.submodule_search_locations spec.loader = loader # While the docs say that module.__file__ is not set for |