MCPcopy Index your code
hub / github.com/RustPython/RustPython / visit_ImportFrom

Method visit_ImportFrom

Lib/pyclbr.py:248–266  ·  view source on GitHub ↗
(self, node)

Source from the content-addressed store, hash-verified

246 continue
247
248 def visit_ImportFrom(self, node):
249 if node.col_offset != 0:
250 return
251 try:
252 module = "." * node.level
253 if node.module:
254 module += node.module
255 module = _readmodule(module, self.path, self.inpackage)
256 except (ImportError, SyntaxError):
257 return
258
259 for name in node.names:
260 if name.name in module:
261 self.tree[name.asname or name.name] = module[name.name]
262 elif name.name == "*":
263 for import_name, import_value in module.items():
264 if import_name.startswith("_"):
265 continue
266 self.tree[import_name] = import_value
267
268
269def _create_tree(fullmodule, path, fname, source, tree, inpackage):

Callers

nothing calls this directly

Calls 3

_readmoduleFunction · 0.85
itemsMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected