@@ -320,6 +320,9 @@ ABC hierarchy::
320320 .. versionchanged :: 3.7
321321 Introduced the optional :meth: `get_resource_reader ` method.
322322
323+ .. versionchanged :: 3.15
324+ Removed the ``load_module() `` method.
325+
323326 .. method :: create_module(spec)
324327
325328 A method that returns the module object to use when
@@ -344,46 +347,6 @@ ABC hierarchy::
344347 .. versionchanged :: 3.6
345348 :meth: `create_module ` must also be defined.
346349
347- .. method :: load_module(fullname)
348-
349- A legacy method for loading a module. If the module cannot be
350- loaded, :exc: `ImportError ` is raised, otherwise the loaded module is
351- returned.
352-
353- If the requested module already exists in :data: `sys.modules `, that
354- module should be used and reloaded.
355- Otherwise the loader should create a new module and insert it into
356- :data: `sys.modules ` before any loading begins, to prevent recursion
357- from the import. If the loader inserted a module and the load fails, it
358- must be removed by the loader from :data: `sys.modules `; modules already
359- in :data: `sys.modules ` before the loader began execution should be left
360- alone.
361-
362- The loader should set several attributes on the module
363- (note that some of these attributes can change when a module is
364- reloaded):
365-
366- - :attr: `module.__name__ `
367- - :attr: `module.__file__ `
368- - :attr: `module.__cached__ ` *(deprecated) *
369- - :attr: `module.__path__ `
370- - :attr: `module.__package__ ` *(deprecated) *
371- - :attr: `module.__loader__ ` *(deprecated) *
372-
373- When :meth: `exec_module ` is available then backwards-compatible
374- functionality is provided.
375-
376- .. versionchanged :: 3.4
377- Raise :exc: `ImportError ` when called instead of
378- :exc: `NotImplementedError `. Functionality provided when
379- :meth: `exec_module ` is available.
380-
381- .. deprecated-removed :: 3.4 3.15
382- The recommended API for loading a module is :meth: `exec_module `
383- (and :meth: `create_module `). Loaders should implement it instead of
384- :meth: `load_module `. The import machinery takes care of all the
385- other responsibilities of :meth: `load_module ` when
386- :meth: `exec_module ` is implemented.
387350
388351
389352.. class :: ResourceLoader
@@ -484,19 +447,14 @@ ABC hierarchy::
484447 Added the *fullname * parameter.
485448
486449
450+
451+
487452 .. method :: exec_module(module)
488453
489454 Implementation of :meth: `Loader.exec_module `.
490455
491456 .. versionadded :: 3.4
492457
493- .. method :: load_module(fullname)
494-
495- Implementation of :meth: `Loader.load_module `.
496-
497- .. deprecated-removed :: 3.4 3.15
498- use :meth: `exec_module ` instead.
499-
500458
501459.. class :: ExecutionLoader
502460
@@ -530,6 +488,9 @@ ABC hierarchy::
530488
531489 .. versionadded :: 3.3
532490
491+ .. versionchanged :: 3.15
492+ Removed the ``load_module() `` method.
493+
533494 .. attribute :: name
534495
535496 The name of the module the loader can handle.
@@ -538,13 +499,6 @@ ABC hierarchy::
538499
539500 Path to the file of the module.
540501
541- .. method :: load_module(fullname)
542-
543- Calls super's ``load_module() ``.
544-
545- .. deprecated-removed :: 3.4 3.15
546- Use :meth: `Loader.exec_module ` instead.
547-
548502 .. method :: get_filename(fullname)
549503 :abstractmethod:
550504
@@ -576,6 +530,9 @@ ABC hierarchy::
576530 optimization to speed up loading by removing the parsing step of Python's
577531 compiler, and so no bytecode-specific API is exposed.
578532
533+ .. versionchanged :: 3.15
534+ Removed the ``load_module() `` method.
535+
579536 .. method :: path_stats(path)
580537
581538 Optional abstract method which returns a :class: `dict ` containing
@@ -629,13 +586,6 @@ ABC hierarchy::
629586
630587 .. versionadded :: 3.4
631588
632- .. method :: load_module(fullname)
633-
634- Concrete implementation of :meth: `Loader.load_module `.
635-
636- .. deprecated-removed :: 3.4 3.15
637- Use :meth: `exec_module ` instead.
638-
639589 .. method :: get_source(fullname)
640590
641591 Concrete implementation of :meth: `InspectLoader.get_source `.
@@ -1059,6 +1009,9 @@ find and load modules.
10591009
10601010 .. versionadded :: 3.3
10611011
1012+ .. versionchanged :: 3.15
1013+ Removed the ``load_module() `` method.
1014+
10621015 .. attribute :: name
10631016
10641017 The name of the module that this loader will handle.
@@ -1079,15 +1032,6 @@ find and load modules.
10791032
10801033 Concrete implementation of :meth: `importlib.abc.SourceLoader.set_data `.
10811034
1082- .. method :: load_module(name=None)
1083-
1084- Concrete implementation of :meth: `importlib.abc.Loader.load_module ` where
1085- specifying the name of the module to load is optional.
1086-
1087- .. deprecated-removed :: 3.6 3.15
1088-
1089- Use :meth: `importlib.abc.Loader.exec_module ` instead.
1090-
10911035
10921036.. class :: SourcelessFileLoader(fullname, path)
10931037
@@ -1101,6 +1045,9 @@ find and load modules.
11011045
11021046 .. versionadded :: 3.3
11031047
1048+ .. versionchanged :: 3.15
1049+ Removed the ``load_module() `` method.
1050+
11041051 .. attribute :: name
11051052
11061053 The name of the module the loader will handle.
@@ -1122,15 +1069,6 @@ find and load modules.
11221069 Returns ``None `` as bytecode files have no source when this loader is
11231070 used.
11241071
1125- .. method :: load_module(name=None)
1126-
1127- Concrete implementation of :meth: `importlib.abc.Loader.load_module ` where
1128- specifying the name of the module to load is optional.
1129-
1130- .. deprecated-removed :: 3.6 3.15
1131-
1132- Use :meth: `importlib.abc.Loader.exec_module ` instead.
1133-
11341072
11351073.. class :: ExtensionFileLoader(fullname, path)
11361074
0 commit comments