Skip to content

Commit

Permalink
Support Python 3.8 (django#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriilahuta authored and carltongibson committed Oct 23, 2019
1 parent d22b720 commit 0378647
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
env: DJANGO="Django==2.1.*"
- python: "3.7"
env: DJANGO="Django==2.2.*"
- python: "3.8"
env: DJANGO="Django==2.2.*"

- stage: lint
install: pip install -U -e .[tests] black pyflakes isort
Expand Down
3 changes: 1 addition & 2 deletions channels/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import types
from concurrent.futures import CancelledError


def name_that_thing(thing):
Expand Down Expand Up @@ -57,5 +56,5 @@ async def await_many_dispatch(consumer_callables, dispatch):
task.cancel()
try:
await task
except CancelledError:
except asyncio.CancelledError:
pass
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
python_requires='>=3.5',
install_requires=[
'Django>=1.11',
'asgiref~=3.0',
'asgiref~=3.2',
'daphne~=2.3',
],
extras_require={
Expand All @@ -39,6 +39,7 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Internet :: WWW/HTTP',
],
)
4 changes: 2 additions & 2 deletions tests/test_testing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from concurrent.futures import TimeoutError
import asyncio
from urllib.parse import unquote

import pytest
Expand Down Expand Up @@ -121,7 +121,7 @@ async def test_timeout_disconnect():
assert subprotocol is None
# Test sending text (will error internally)
await communicator.send_to(text_data="hello")
with pytest.raises(TimeoutError):
with pytest.raises(asyncio.TimeoutError):
await communicator.receive_from()
# Close out
await communicator.disconnect()
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37}-dj{11,21,22,master}
envlist = py{36,37,38}-dj{11,21,22,master}

[testenv]
usedevelop = true
Expand Down

0 comments on commit 0378647

Please sign in to comment.