Helper to correctly register callbacks to __exit__ methods.
(self, cm, cm_exit)
| 545 | return callback # Allow use as a decorator |
| 546 | |
| 547 | def _push_cm_exit(self, cm, cm_exit): |
| 548 | """Helper to correctly register callbacks to __exit__ methods.""" |
| 549 | _exit_wrapper = self._create_exit_wrapper(cm, cm_exit) |
| 550 | self._push_exit_callback(_exit_wrapper, True) |
| 551 | |
| 552 | def _push_exit_callback(self, callback, is_sync=True): |
| 553 | self._exit_callbacks.append((is_sync, callback)) |
no test coverage detected