Skip to content

Conversation

@musicinmybrain
Copy link
Contributor

Passing coroutine objects to wait() directly is deprecated since Python version 3.8 and will be removed in version 3.11:

https://docs.python.org/3/library/asyncio-task.html#asyncio.wait

This change eliminates the following DeprecationWarning:

tests/asyncio/test_asyncio_server.py::TestAsyncServer::test_disconnect_all
  /builddir/build/BUILDROOT/python-engineio-4.3.2-1.fc37.x86_64/usr/lib/python3.10/site-packages/engineio/asyncio_server.py:178: 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([client.close()

on Python 3.8–3.10, and it fixes failure of:

tests/asyncio/test_asyncio_server.py::TestAsyncServer::test_disconnect_all

on Python 3.11.0b3 (pre-release).

This change is a partial fix for #279.

The implementation is based on the example in the Python documentation.

Passing coroutine objects to wait() directly is deprecated since Python
version 3.8 and will be removed in version 3.11:

  https://docs.python.org/3/library/asyncio-task.html#asyncio.wait

This change eliminates the following DeprecationWarning:

  tests/asyncio/test_asyncio_server.py::TestAsyncServer::test_disconnect_all
    /builddir/build/BUILDROOT/python-engineio-4.3.2-1.fc37.x86_64/usr/lib/python3.10/site-packages/engineio/asyncio_server.py:178: 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([client.close()

on Python 3.8–3.10, and it fixes failure of:

  tests/asyncio/test_asyncio_server.py::TestAsyncServer::test_disconnect_all

on Python 3.11.0b3 (pre-release).

This change is a partial fix for miguelgrinberg#279.
@miguelgrinberg miguelgrinberg merged commit d3a23c0 into miguelgrinberg:main Jun 8, 2022
@miguelgrinberg
Copy link
Owner

Thank you so much!

@musicinmybrain
Copy link
Contributor Author

You’re welcome! Thank you for reviewing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants