asyncio.py 333 B

1234567891011
  1. from __future__ import annotations
  2. import asyncio
  3. import sys
  4. from collections.abc import Callable
  5. def asyncio_loop_factory(use_subprocess: bool = False) -> Callable[[], asyncio.AbstractEventLoop]:
  6. if sys.platform == "win32" and not use_subprocess:
  7. return asyncio.ProactorEventLoop
  8. return asyncio.SelectorEventLoop