MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / import_name

Function import_name

_pydevd_bundle/pydevd_import_class.py:52–70  ·  view source on GitHub ↗
(name, log=None)

Source from the content-addressed store, hash-verified

50
51
52def import_name(name, log=None):
53 mod = _imp(name, log)
54
55 components = name.split(".")
56
57 old_comp = None
58 for comp in components[1:]:
59 try:
60 # this happens in the following case:
61 # we have mx.DateTime.mxDateTime.mxDateTime.pyd
62 # but after importing it, mx.DateTime.mxDateTime shadows access to mxDateTime.pyd
63 mod = getattr(mod, comp)
64 except AttributeError:
65 if old_comp != comp:
66 raise
67
68 old_comp = comp
69
70 return mod

Callers

nothing calls this directly

Calls 1

_impFunction · 0.70

Tested by

no test coverage detected