[3.9] bpo-23819: Fix asyncio tests on python optimized mode (GH-30195) (GH-30265)

(cherry picked from commit a23ab7b6d8)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2021-12-26 03:54:18 -08:00 committed by GitHub
parent f1f54c8fb9
commit 07229054a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View file

@ -1290,8 +1290,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,