diff options
author | Brett Cannon <brett@python.org> | 2016-01-15 21:33:03 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-01-15 21:33:03 (GMT) |
commit | 63b8505281f9c26f7304b3e00d658b429b862d5b (patch) | |
tree | 07a4d20ed327d8493aa7105bec9ca1d598cc6b7c /Doc/reference | |
parent | 43cfd8240c274b2f4cf0588f3defae83e7379a55 (diff) | |
download | cpython-63b8505281f9c26f7304b3e00d658b429b862d5b.zip cpython-63b8505281f9c26f7304b3e00d658b429b862d5b.tar.gz cpython-63b8505281f9c26f7304b3e00d658b429b862d5b.tar.bz2 |
Issue #25791: Raise an ImportWarning when __spec__ or __package__ are
not defined for a relative import.
This is the start of work to try and clean up import semantics to rely
more on a module's spec than on the myriad attributes that get set on
a module. Thanks to Rose Ames for the patch.
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/import.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index 2144c1f..a162851 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -554,7 +554,8 @@ the module. details. This attribute is used instead of ``__name__`` to calculate explicit - relative imports for main modules, as defined in :pep:`366`. + relative imports for main modules -- as defined in :pep:`366` -- + when ``__spec__`` is not defined. .. attribute:: __spec__ |