Skip to content

Commit 561bd00

Browse files
CharlieZhao95kumaraditya303
authored andcommitted
[3.9] gh-98793: Fix typecheck in overlapped.c (GH-98835) (GH-98890)
(cherry picked from commit d3d1738) Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> (cherry picked from commit 3ac8c0a)
1 parent d3118eb commit 561bd00

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Lib/test/test_asyncio/test_windows_events.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,17 @@ def threadMain():
279279
stop.set()
280280
thr.join()
281281

282+
def test_address_argument_type_error(self):
283+
# Regression test for https://github.com/python/cpython/issues/98793
284+
proactor = self.loop._proactor
285+
sock = socket.socket(type=socket.SOCK_DGRAM)
286+
bad_address = None
287+
with self.assertRaises(TypeError):
288+
proactor.connect(sock, bad_address)
289+
with self.assertRaises(TypeError):
290+
proactor.sendto(sock, b'abc', addr=bad_address)
291+
sock.close()
292+
282293

283294
class WinPolicyTests(WindowsEventsTestCase):
284295

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix argument typechecks in :func:`!_overlapped.WSAConnect` and :func:`!_overlapped.Overlapped.WSASendTo` functions.

0 commit comments

Comments
 (0)