MagicStack / asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.
Apache License 2.0
6.88k stars 399 forks source link

Switch to Python 3.12-style `wait_for` #1086

Closed elprans closed 11 months ago

elprans commented 11 months ago

wait_for has been a mess with respect to cancellations consistently in asyncio. Hopefully the approach taken in Python 3.12 solves the issues, so adopt that instead of trying to "fix" wait_for with wrappers on older Pythons. Use async_timeout as a polyfill on pre-3.11 Python.

Closes: #1056 Closes: #1052 Fixes: #955