diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 60f106f2d1a..32252f7b741 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -2562,8 +2562,7 @@ def testHyperVConstants(self): socket.HV_GUID_LOOPBACK def testCreateHyperVSocketWithUnknownProtoFailure(self): - expected = "A protocol was specified in the socket function call " \ - "that does not support the semantics of the socket type requested" + expected = r"\[WinError 10041\]" with self.assertRaisesRegex(OSError, expected): socket.socket(socket.AF_HYPERV, socket.SOCK_STREAM)