| 149 | |
| 150 | |
| 151 | class _CancellationContext: |
| 152 | def __init__(self) -> None: |
| 153 | self._cancelled = False |
| 154 | |
| 155 | def cancel(self) -> None: |
| 156 | """Cancel this context.""" |
| 157 | self._cancelled = True |
| 158 | |
| 159 | @property |
| 160 | def cancelled(self) -> bool: |
| 161 | """Was cancel called?""" |
| 162 | return self._cancelled |
| 163 | |
| 164 | |
| 165 | async def _async_create_connection(address: _Address, options: PoolOptions) -> socket.socket: |