Skip to content

Commit fd596d2

Browse files
authored
DOC improve module reconstructor docs (#407)
1 parent a0862be commit fd596d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: cloudpickle/cloudpickle.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,11 @@ def _rebuild_tornado_coroutine(func):
560560
loads = pickle.loads
561561

562562

563-
# hack for __import__ not working as desired
564563
def subimport(name):
564+
# We cannot do simply: `return __import__(name)`: Indeed, if ``name`` is
565+
# the name of a submodule, __import__ will return the top-level root module
566+
# of this submodule. For instance, __import__('os.path') returns the `os`
567+
# module.
565568
__import__(name)
566569
return sys.modules[name]
567570

0 commit comments

Comments
 (0)