diff --git a/.circleci/config.yml b/.circleci/config.yml index 68d02416d..7be85d7f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,6 +38,15 @@ jobs: - checkout - run: sudo pip install tox - run: tox -e py38 + py39: + docker: + - image: circleci/python:3.9.0b1 + steps: + # Remove IPv6 entry for localhost in Circle CI containers because it doesn't work anyway. + - run: sudo cp /etc/hosts /tmp; sudo sed -i '/::1/d' /tmp/hosts; sudo cp /tmp/hosts /etc + - checkout + - run: sudo pip install tox + - run: tox -e py39 workflows: version: 2 @@ -53,3 +62,6 @@ workflows: - py38: requires: - main + - py39: + requires: + - main diff --git a/.gitignore b/.gitignore index ef0d16520..c23cf5210 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.pyc *.so .coverage +.idea/ .mypy_cache .tox build/ diff --git a/src/websockets/server.py b/src/websockets/server.py index 1d8de8914..e9318a4df 100644 --- a/src/websockets/server.py +++ b/src/websockets/server.py @@ -714,7 +714,10 @@ async def _close(self) -> None: # asyncio.wait doesn't accept an empty first argument if self.websockets: await asyncio.wait( - [websocket.close(1001) for websocket in self.websockets], + [ + asyncio.ensure_future(websocket.close(1001)) + for websocket in self.websockets + ], loop=self.loop if sys.version_info[:2] < (3, 8) else None, ) diff --git a/tox.ini b/tox.ini index 825e34061..cc224f9c6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,coverage,black,flake8,isort,mypy +envlist = py36,py37,py38,py39,coverage,black,flake8,isort,mypy [testenv] commands = python -W default -m unittest {posargs}