(self, func)
| 200 | def __call__(self, func): |
| 201 | if asyncio.iscoroutinefunction(func): |
| 202 | |
| 203 | @wraps(func) |
| 204 | async def async_wrapper(*args, **kwargs): |
| 205 | async with self: |
| 206 | return await func(*args, **kwargs) |
| 207 | |
| 208 | return async_wrapper |
| 209 | else: |
| 210 | |
| 211 | @wraps(func) |
| 212 | def sync_wrapper(*args, **kwargs): |
| 213 | with self: |
| 214 | return func(*args, **kwargs) |
| 215 | |
| 216 | return sync_wrapper |
| 217 | |
| 218 | |
| 219 | class _NullContext: |
| 220 | # Context manager without decision branch logic overhead |
| 221 | def __init__(self, *args, **kwargs): |
nothing calls this directly
no outgoing calls
no test coverage detected