_async.py 907 B

12345678910111213141516171819202122232425262728
  1. """Facade that provides coroutines implementation pertinent to running Py version.
  2. Python 3.5 introduced the async def/await syntax keyword.
  3. With later versions coroutines and methods to get the running asyncio loop are
  4. being deprecated, not supported anymore.
  5. For Python versions later than 3.6, coroutines and objects that are defined via
  6. ``async def``/``await`` keywords are imported.
  7. Here the code is just imported, to provide the same interface to older code.
  8. """
  9. # pylint: disable=unused-import
  10. # flake8: noqa: F401
  11. from sys import version_info as py_version_info
  12. # this assumes async def/await are more stable
  13. if py_version_info >= (3, 6):
  14. from pexpect._async_w_await import (
  15. PatternWaiter,
  16. expect_async,
  17. repl_run_command_async,
  18. )
  19. else:
  20. from pexpect._async_pre_await import (
  21. PatternWaiter,
  22. expect_async,
  23. repl_run_command_async,
  24. )