ansible / ansible-sdk

The Ansible SDK
Apache License 2.0
25 stars 14 forks source link

Fix warning about asyncio.wait() usage #27

Closed Shrews closed 2 years ago

Shrews commented 2 years ago

Currently seeing this warning when using the SDK:

/home/runner/work/ansible-sdk/ansible-sdk/ansible_sdk/model/job_status.py:64: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
    await asyncio.wait([self._newevent.wait(), self._done.wait()], return_when=asyncio.FIRST_COMPLETED)

Solution seems to be to manually wrap the coroutines in tasks.