mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Clean up docstring from importlib.util.module_for_loader.
This commit is contained in:
parent
22b1331930
commit
0e0d8a63b1
1 changed files with 7 additions and 7 deletions
|
@ -128,14 +128,14 @@ def set_loader(fxn):
|
||||||
def module_for_loader(fxn):
|
def module_for_loader(fxn):
|
||||||
"""Decorator to handle selecting the proper module for loaders.
|
"""Decorator to handle selecting the proper module for loaders.
|
||||||
|
|
||||||
Decorated modules are passed the module to use instead of the module name.
|
The decorated function is passed the module to use instead of the module
|
||||||
The module is either from sys.modules if it already exists (for reloading)
|
name. The module passed in to the function is either from sys.modules if
|
||||||
or is a new module which has __name__ set. If any exception is raised by
|
it already exists or is a new module which has __name__ set and is inserted
|
||||||
the decorated method and the decorator added a module to sys.modules, then
|
into sys.modules. If an exception is raised and the decorator created the
|
||||||
the module is deleted from sys.modules.
|
module it is subsequently removed from sys.modules.
|
||||||
|
|
||||||
The decorator assumes that the decorated method takes self/cls as a first
|
The decorator assumes that the decorated function takes the module name as
|
||||||
argument and the module as the second argument.
|
the second argument.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def decorated(self, fullname):
|
def decorated(self, fullname):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue