bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5503)

* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.

https://bugs.python.org/issue32303
https://bugs.python.org/issue32305
(cherry picked from commit bbbcf8693b)

Co-authored-by: Barry Warsaw <barry@python.org>
This commit is contained in:
Barry Warsaw 2018-02-02 19:49:25 -05:00 committed by GitHub
parent 2b5937ec0a
commit a23d30f64b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 1478 additions and 1436 deletions

View file

@ -1291,7 +1291,7 @@ find and load modules.
Name of the place from which the module is loaded, e.g. "builtin" for
built-in modules and the filename for modules loaded from source.
Normally "origin" should be set, but it may be ``None`` (the default)
which indicates it is unspecified.
which indicates it is unspecified (e.g. for namespace packages).
.. attribute:: submodule_search_locations