@@ -314,9 +314,7 @@ typedef struct {
314
314
* store exception information on the socket. The handshake, read, write,
315
315
* and shutdown methods check for chained exceptions.
316
316
*/
317
- PyObject * exc_type ;
318
- PyObject * exc_value ;
319
- PyObject * exc_tb ;
317
+ PyObject * exc ;
320
318
} PySSLSocket ;
321
319
322
320
typedef struct {
@@ -560,13 +558,10 @@ fill_and_set_sslerror(_sslmodulestate *state,
560
558
561
559
static int
562
560
PySSL_ChainExceptions (PySSLSocket * sslsock ) {
563
- if (sslsock -> exc_type == NULL )
561
+ if (sslsock -> exc == NULL )
564
562
return 0 ;
565
563
566
- _PyErr_ChainExceptions (sslsock -> exc_type , sslsock -> exc_value , sslsock -> exc_tb );
567
- sslsock -> exc_type = NULL ;
568
- sslsock -> exc_value = NULL ;
569
- sslsock -> exc_tb = NULL ;
564
+ _PyErr_ChainExceptions1 (sslsock -> exc );
570
565
return -1 ;
571
566
}
572
567
@@ -803,9 +798,7 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
803
798
self -> owner = NULL ;
804
799
self -> server_hostname = NULL ;
805
800
self -> err = err ;
806
- self -> exc_type = NULL ;
807
- self -> exc_value = NULL ;
808
- self -> exc_tb = NULL ;
801
+ self -> exc = NULL ;
809
802
810
803
/* Make sure the SSL error state is initialized */
811
804
ERR_clear_error ();
@@ -2175,19 +2168,15 @@ Passed as \"self\" in servername callback.");
2175
2168
static int
2176
2169
PySSL_traverse (PySSLSocket * self , visitproc visit , void * arg )
2177
2170
{
2178
- Py_VISIT (self -> exc_type );
2179
- Py_VISIT (self -> exc_value );
2180
- Py_VISIT (self -> exc_tb );
2171
+ Py_VISIT (self -> exc );
2181
2172
Py_VISIT (Py_TYPE (self ));
2182
2173
return 0 ;
2183
2174
}
2184
2175
2185
2176
static int
2186
2177
PySSL_clear (PySSLSocket * self )
2187
2178
{
2188
- Py_CLEAR (self -> exc_type );
2189
- Py_CLEAR (self -> exc_value );
2190
- Py_CLEAR (self -> exc_tb );
2179
+ Py_CLEAR (self -> exc );
2191
2180
return 0 ;
2192
2181
}
2193
2182
@@ -2532,7 +2521,7 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
2532
2521
PySSL_SetError (self , retval , __FILE__ , __LINE__ );
2533
2522
goto error ;
2534
2523
}
2535
- if (self -> exc_type != NULL )
2524
+ if (self -> exc != NULL )
2536
2525
goto error ;
2537
2526
2538
2527
done :
@@ -2658,7 +2647,7 @@ _ssl__SSLSocket_shutdown_impl(PySSLSocket *self)
2658
2647
PySSL_SetError (self , ret , __FILE__ , __LINE__ );
2659
2648
return NULL ;
2660
2649
}
2661
- if (self -> exc_type != NULL )
2650
+ if (self -> exc != NULL )
2662
2651
goto error ;
2663
2652
if (sock )
2664
2653
/* It's already INCREF'ed */
0 commit comments