File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1077,6 +1077,13 @@ def smuggle(
10771077 # invalidate sys.meta_path module finder caches. Forces import
10781078 # machinery to notice newly installed module
10791079 importlib .invalidate_caches ()
1080+ # if pkg_resources module has already been loaded, reload it in
1081+ # case the just-installed package uses it internally to populate
1082+ # its __version__ attribute from its metadata, Otherwise,
1083+ # pkg_resources's cached working set won't include the new
1084+ # package
1085+ if 'pkg_resources' in sys .modules :
1086+ importlib .reload (sys .modules ['pkg_resources' ])
10801087 # check whether the smuggled package and/or any
10811088 # installed/updated dependencies were already imported during
10821089 # the current runtime
You can’t perform that action at this time.
0 commit comments