bpo-23819: Fix asyncio tests on python optimized mode (GH-30195)

This commit is contained in:
Kumar Aditya 2021-12-26 16:43:14 +05:30 committed by GitHub
parent f9a4352056
commit a23ab7b6d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View file

@ -1285,8 +1285,8 @@ class BaseEventLoop(events.AbstractEventLoop):
addr_infos = {} # Using order preserving dict
for idx, addr in ((0, local_addr), (1, remote_addr)):
if addr is not None:
assert isinstance(addr, tuple) and len(addr) == 2, (
'2-tuple is expected')
if not (isinstance(addr, tuple) and len(addr) == 2):
raise TypeError('2-tuple is expected')
infos = await self._ensure_resolved(
addr, family=family, type=socket.SOCK_DGRAM,