(var, attr, origin_attr)
| 482 | # returns a bound method. Re-wrap as classmethod so subclasses still get |
| 483 | # `cls` bound to themselves (not to the ancestor that was patched). |
| 484 | def _restore(var, attr, origin_attr): |
| 485 | origin = getattr(var, origin_attr) |
| 486 | if isinstance(origin, MethodType): |
| 487 | setattr(var, attr, classmethod(origin.__func__)) |
| 488 | else: |
| 489 | setattr(var, attr, origin) |
| 490 | try: |
| 491 | delattr(var, origin_attr) |
| 492 | except Exception: # noqa |
| 493 | pass |
| 494 | |
| 495 | for var in all_imported_modules: |
| 496 | if var is None: |
no outgoing calls
no test coverage detected
searching dependent graphs…