Skip to content

Commit

Permalink
DOC improve module reconstructor docs (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreglaser committed Mar 1, 2021
1 parent a0862be commit fd596d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cloudpickle/cloudpickle.py
Expand Up @@ -560,8 +560,11 @@ def _rebuild_tornado_coroutine(func):
loads = pickle.loads


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

Expand Down

0 comments on commit fd596d2

Please sign in to comment.