summaryrefslogtreecommitdiff
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2021-12-26 16:43:14 +0530
committerGitHub <noreply@github.com>2021-12-26 13:13:14 +0200
commita23ab7b6d8b3ae3a47747c0c4bceb2370cc48dcc (patch)
treea5bae88b99eebf1ac94a70964f5b6d0609942eda /Lib/asyncio/base_events.py
parentf9a4352056175d96195d4cb54c97c1334ea5150c (diff)
downloadcpython-git-a23ab7b6d8b3ae3a47747c0c4bceb2370cc48dcc.tar.gz
bpo-23819: Fix asyncio tests on python optimized mode (GH-30195)
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index cbf6d5db0a..56ea7ba44e 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -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,