[3.11] gh-98793: Fix typecheck in overlapped.c (GH-98835) (#98889)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 3ac8c0ab6e)
This commit is contained in:
Charlie Zhao 2022-11-01 02:21:01 +08:00 committed by GitHub
parent a4f8db19ad
commit 2b0cbb90c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 9 deletions

View file

@ -239,6 +239,17 @@ class ProactorTests(test_utils.TestCase):
self.close_loop(self.loop)
self.assertFalse(self.loop.call_exception_handler.called)
def test_address_argument_type_error(self):
# Regression test for https://github.com/python/cpython/issues/98793
proactor = self.loop._proactor
sock = socket.socket(type=socket.SOCK_DGRAM)
bad_address = None
with self.assertRaises(TypeError):
proactor.connect(sock, bad_address)
with self.assertRaises(TypeError):
proactor.sendto(sock, b'abc', addr=bad_address)
sock.close()
class WinPolicyTests(test_utils.TestCase):