[7.x] Add support for Python 3.9
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
import sys
|
||||||
|
|
||||||
from .compat import get_running_loop
|
from .compat import get_running_loop
|
||||||
from .http_aiohttp import AIOHttpConnection
|
from .http_aiohttp import AIOHttpConnection
|
||||||
@@ -162,9 +163,13 @@ class AsyncTransport(Transport):
|
|||||||
done = ()
|
done = ()
|
||||||
try:
|
try:
|
||||||
while tasks:
|
while tasks:
|
||||||
|
# The 'loop' keyword is deprecated in 3.8+ so don't
|
||||||
|
# pass it to asyncio.wait() unless we're on <=3.7
|
||||||
|
wait_kwargs = {"loop": self.loop} if sys.version_info < (3, 8) else {}
|
||||||
|
|
||||||
# execute sniff requests in parallel, wait for first to return
|
# execute sniff requests in parallel, wait for first to return
|
||||||
done, tasks = await asyncio.wait(
|
done, tasks = await asyncio.wait(
|
||||||
tasks, return_when=asyncio.FIRST_COMPLETED, loop=self.loop
|
tasks, return_when=asyncio.FIRST_COMPLETED, **wait_kwargs
|
||||||
)
|
)
|
||||||
# go through all the finished tasks
|
# go through all the finished tasks
|
||||||
for t in done:
|
for t in done:
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ setup(
|
|||||||
"Programming Language :: Python :: 3.6",
|
"Programming Language :: Python :: 3.6",
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Programming Language :: Python :: Implementation :: PyPy",
|
"Programming Language :: Python :: Implementation :: PyPy",
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user