(cls, attr, around)
| 416 | |
| 417 | @classmethod |
| 418 | def add_around(cls, attr, around): |
| 419 | orig = getattr(cls, attr) |
| 420 | if getattr(orig, '__wrapped__', None): |
| 421 | orig = orig.__wrapped__ |
| 422 | meth = around(orig) |
| 423 | meth.__wrapped__ = orig |
| 424 | setattr(cls, attr, meth) |
| 425 | |
| 426 | def __call__(self, *args, **kwargs): |
| 427 | _task_stack.push(self) |