Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings for python 3.10 #262

Merged
merged 1 commit into from
May 22, 2021
Merged

Fix deprecation warnings for python 3.10 #262

merged 1 commit into from
May 22, 2021

Commits on May 20, 2021

  1. Fix deprecation warnings for python 3.10

    asyncio.get_event_loop was marked as deprecated, the documnetation
    now refers to asyncio.get_running_loop([1])
    
    asyncio.ensure_future issues a deprecation warning if there is no
    running event loop([2]), so use asyncio.run which creates and destroys the
    loop itself
    
    asyncio.gather issues a warning if run outside of event
    loop (i.e. there is no running event loop)([3]), so wrap it into an
    async def
    
    explicit passing of coroutine objects to asyncio.wait is deprecated
    since 3.8([4]), so wrap them in asyncio.create_task
    
    plus, add 3.10 to tox.ini
    
    [1]: https://docs.python.org/3.10/library/asyncio-eventloop.html#asyncio.get_event_loop
    [2]: https://docs.python.org/3.10/library/asyncio-future.html#asyncio.ensure_future
    [3]: https://docs.python.org/3.10/library/asyncio-task.html#asyncio.gather
    [4]: https://docs.python.org/3.10/library/asyncio-task.html#asyncio.wait
    vaartis committed May 20, 2021
    Configuration menu
    Copy the full SHA
    0c9e989 View commit details
    Browse the repository at this point in the history