Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up a few last minute things
  • Loading branch information
warsaw committed Oct 6, 2022
commit 3bcdba951c4f6df2ff19ff630708d744da8a2350
4 changes: 2 additions & 2 deletions Doc/reference/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ listed below.

.. versionchanged:: 3.12
The value of ``__loader__`` is expected to be the same as
``__spec__.loader``. If they are not, an :exc:`ImportWarning` will be
raised.
``__spec__.loader``. The use of ``__loader__`` is deprecated and slated
for removal in Python 3.14.

.. attribute:: __package__

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
In cases where ``warnings.warn_explicit()`` consults the module's loader, an
``ImportWarning`` is issued when ``m.__loader__`` differs from
``DeprecationWarning`` is issued when ``m.__loader__`` differs from
``m.__spec__.loader``.
1 change: 1 addition & 0 deletions Python/_warnings.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ get_source_line(PyInterpreterState *interp, PyObject *module_globals, int lineno

module_name = _PyDict_GetItemWithError(module_globals, &_Py_ID(__name__));
if (!module_name) {
Py_DECREF(loader);
return NULL;
}
Py_INCREF(module_name);
Expand Down