(name, log=None)
| 50 | |
| 51 | |
| 52 | def 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 |