Skip to content

Commit

Permalink
[3.6] Fix python 3.8 warnings (#4264). (#4570)
Browse files Browse the repository at this point in the history
  • Loading branch information
TBBle committed Apr 24, 2020
1 parent 5fb0179 commit 1dda663
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ async def _create_direct_connection(
hosts = await asyncio.shield(self._resolve_host(
host,
port,
traces=traces), loop=self._loop)
traces=traces))
except OSError as exc:
# in case of proxy it is not ClientProxyConnectionError
# it is problem of resolving proxy ip itself
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EventResultOrError:
def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
self._loop = loop
self._exc = None # type: Optional[BaseException]
self._event = asyncio.Event(loop=loop)
self._event = asyncio.Event()
self._waiters = collections.deque() # type: Deque[asyncio.Future[Any]]

def set(self, exc: Optional[BaseException]=None) -> None:
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _make_request(self, message: RawRequestMessage,

async def shutdown(self, timeout: Optional[float]=None) -> None:
coros = [conn.shutdown(timeout) for conn in self._connections]
await asyncio.gather(*coros, loop=self._loop)
await asyncio.gather(*coros)
self._connections.clear()

def __call__(self) -> RequestHandler:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
async def test_subprocess_co(loop) -> None:
assert isinstance(threading.current_thread(), threading._MainThread)
proc = await asyncio.create_subprocess_shell(
"exit 0", loop=loop, stdin=asyncio.subprocess.DEVNULL,
"exit 0", stdin=asyncio.subprocess.DEVNULL,
stdout=asyncio.subprocess.DEVNULL, stderr=asyncio.subprocess.DEVNULL)
await proc.wait()

Expand Down
5 changes: 1 addition & 4 deletions tests/test_web_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,7 @@ async def handler(request):
app.router.add_route('POST', '/', handler)
server = await aiohttp_server(app, logger=logger)

if helpers.PY_38:
writer = await asyncio.connect('127.0.0.1', server.port)
else:
_, writer = await asyncio.open_connection('127.0.0.1', server.port)
_, writer = await asyncio.open_connection('127.0.0.1', server.port)
writer.write("""POST / HTTP/1.1\r
Connection: keep-alive\r
Content-Length: 10\r
Expand Down

0 comments on commit 1dda663

Please sign in to comment.