(name, log=None)
| 86 | |
| 87 | |
| 88 | def Find(name, log=None): |
| 89 | f = None |
| 90 | |
| 91 | mod = _imp(name, log) |
| 92 | parent = mod |
| 93 | foundAs = "" |
| 94 | |
| 95 | if inspect.ismodule(mod): |
| 96 | f = get_file(mod) |
| 97 | |
| 98 | components = name.split(".") |
| 99 | |
| 100 | old_comp = None |
| 101 | for comp in components[1:]: |
| 102 | try: |
| 103 | # this happens in the following case: |
| 104 | # we have mx.DateTime.mxDateTime.mxDateTime.pyd |
| 105 | # but after importing it, mx.DateTime.mxDateTime shadows access to mxDateTime.pyd |
| 106 | mod = getattr(mod, comp) |
| 107 | except AttributeError: |
| 108 | if old_comp != comp: |
| 109 | raise |
| 110 | |
| 111 | if inspect.ismodule(mod): |
| 112 | f = get_file(mod) |
| 113 | else: |
| 114 | if len(foundAs) > 0: |
| 115 | foundAs = foundAs + "." |
| 116 | foundAs = foundAs + comp |
| 117 | |
| 118 | old_comp = comp |
| 119 | |
| 120 | return f, mod, parent, foundAs |
| 121 | |
| 122 | |
| 123 | def search_definition(data): |
no test coverage detected