File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,7 +79,9 @@ This module provides an interface to the mechanisms used to implement the
7979 When *P * itself has a dotted name, apply this recipe recursively.
8080
8181 .. deprecated :: 3.3
82- Use :func: `importlib.find_loader ` instead.
82+ Use :func: `importlib.util.find_spec ` instead unless Python 3.3
83+ compatibility is required, in which case use
84+ :func: `importlib.find_loader `.
8385
8486
8587.. function :: load_module(name, file, pathname, description)
@@ -104,9 +106,11 @@ This module provides an interface to the mechanisms used to implement the
104106
105107 .. deprecated :: 3.3
106108 If previously used in conjunction with :func: `imp.find_module ` then
107- call ``load_module() `` on the returned loader. If you wish to load a
108- module from a specific file, then use one of the file-based loaders found
109- in :mod: `importlib.machinery `.
109+ consider using :func: `importlib.import_module `, otherwise use the loader
110+ returned by the replacement you chose for :func: `imp.find_module `. If you
111+ called :func: `imp.load_module ` and related functions directly then use the
112+ classes in :mod: `importlib.machinery `, e.g.
113+ ``importlib.machinery.SourceFileLoader(name, path).load_module() ``.
110114
111115
112116.. function :: new_module(name)
You can’t perform that action at this time.
0 commit comments