@@ -370,7 +370,7 @@ static PyObject *PySSL_SSLdo_handshake(PySSLSocket *self)
370370 sockstate = SOCKET_OPERATION_OK ;
371371 }
372372 if (sockstate == SOCKET_HAS_TIMED_OUT ) {
373- PyErr_SetString (PySSLErrorObject ,
373+ PyErr_SetString (PySocketModule . timeout_error ,
374374 ERRSTR ("The handshake operation timed out" ));
375375 goto error ;
376376 } else if (sockstate == SOCKET_HAS_BEEN_CLOSED ) {
@@ -1075,7 +1075,7 @@ static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args)
10751075
10761076 sockstate = check_socket_and_wait_for_timeout (sock , 1 );
10771077 if (sockstate == SOCKET_HAS_TIMED_OUT ) {
1078- PyErr_SetString (PySSLErrorObject ,
1078+ PyErr_SetString (PySocketModule . timeout_error ,
10791079 "The write operation timed out" );
10801080 goto error ;
10811081 } else if (sockstate == SOCKET_HAS_BEEN_CLOSED ) {
@@ -1104,7 +1104,7 @@ static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args)
11041104 sockstate = SOCKET_OPERATION_OK ;
11051105 }
11061106 if (sockstate == SOCKET_HAS_TIMED_OUT ) {
1107- PyErr_SetString (PySSLErrorObject ,
1107+ PyErr_SetString (PySocketModule . timeout_error ,
11081108 "The write operation timed out" );
11091109 goto error ;
11101110 } else if (sockstate == SOCKET_HAS_BEEN_CLOSED ) {
@@ -1211,7 +1211,7 @@ static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args)
12111211 if (!count ) {
12121212 sockstate = check_socket_and_wait_for_timeout (sock , 0 );
12131213 if (sockstate == SOCKET_HAS_TIMED_OUT ) {
1214- PyErr_SetString (PySSLErrorObject ,
1214+ PyErr_SetString (PySocketModule . timeout_error ,
12151215 "The read operation timed out" );
12161216 goto error ;
12171217 } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT ) {
@@ -1245,7 +1245,7 @@ static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args)
12451245 sockstate = SOCKET_OPERATION_OK ;
12461246 }
12471247 if (sockstate == SOCKET_HAS_TIMED_OUT ) {
1248- PyErr_SetString (PySSLErrorObject ,
1248+ PyErr_SetString (PySocketModule . timeout_error ,
12491249 "The read operation timed out" );
12501250 goto error ;
12511251 } else if (sockstate == SOCKET_IS_NONBLOCKING ) {
@@ -1340,10 +1340,10 @@ static PyObject *PySSL_SSLshutdown(PySSLSocket *self)
13401340 break ;
13411341 if (sockstate == SOCKET_HAS_TIMED_OUT ) {
13421342 if (ssl_err == SSL_ERROR_WANT_READ )
1343- PyErr_SetString (PySSLErrorObject ,
1343+ PyErr_SetString (PySocketModule . timeout_error ,
13441344 "The read operation timed out" );
13451345 else
1346- PyErr_SetString (PySSLErrorObject ,
1346+ PyErr_SetString (PySocketModule . timeout_error ,
13471347 "The write operation timed out" );
13481348 goto error ;
13491349 }
0 commit comments