We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0862be commit fd596d2Copy full SHA for fd596d2
cloudpickle/cloudpickle.py
@@ -560,8 +560,11 @@ def _rebuild_tornado_coroutine(func):
560
loads = pickle.loads
561
562
563
-# hack for __import__ not working as desired
564
def subimport(name):
+ # 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.
568
__import__(name)
569
return sys.modules[name]
570
0 commit comments