MCPcopy Index your code
hub / github.com/python/cpython / ensure_fromlist

Method ensure_fromlist

Lib/modulefinder.py:260–272  ·  view source on GitHub ↗
(self, m, fromlist, recursive=0)

Source from the content-addressed store, hash-verified

258 return m
259
260 def ensure_fromlist(self, m, fromlist, recursive=0):
261 self.msg(4, "ensure_fromlist", m, fromlist, recursive)
262 for sub in fromlist:
263 if sub == "*":
264 if not recursive:
265 all = self.find_all_submodules(m)
266 if all:
267 self.ensure_fromlist(m, all, 1)
268 elif not hasattr(m, sub):
269 subname = "%s.%s" % (m.__name__, sub)
270 submod = self.import_module(sub, subname, m)
271 if not submod:
272 raise ImportError("No module named " + subname)
273
274 def find_all_submodules(self, m):
275 if not m.__path__:

Callers 1

import_hookMethod · 0.95

Calls 3

msgMethod · 0.95
find_all_submodulesMethod · 0.95
import_moduleMethod · 0.95

Tested by

no test coverage detected