| 142 | |
| 143 | |
| 144 | class MovedAttribute(_LazyDescr): |
| 145 | |
| 146 | def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None): |
| 147 | super(MovedAttribute, self).__init__(name) |
| 148 | if PY3: |
| 149 | if new_mod is None: |
| 150 | new_mod = name |
| 151 | self.mod = new_mod |
| 152 | if new_attr is None: |
| 153 | if old_attr is None: |
| 154 | new_attr = name |
| 155 | else: |
| 156 | new_attr = old_attr |
| 157 | self.attr = new_attr |
| 158 | else: |
| 159 | self.mod = old_mod |
| 160 | if old_attr is None: |
| 161 | old_attr = name |
| 162 | self.attr = old_attr |
| 163 | |
| 164 | def _resolve(self): |
| 165 | module = _import_module(self.mod) |
| 166 | return getattr(module, self.attr) |
| 167 | |
| 168 | |
| 169 | class _SixMetaPathImporter(object): |
no outgoing calls
no test coverage detected
searching dependent graphs…