]> granicus.if.org Git - python/commitdiff
Issue #9693 - msg 115273: attempt to fix ssl module failures on certain OpenSSL versi...
authorGiampaolo Rodolà <g.rodola@gmail.com>
Wed, 1 Sep 2010 19:28:49 +0000 (19:28 +0000)
committerGiampaolo Rodolà <g.rodola@gmail.com>
Wed, 1 Sep 2010 19:28:49 +0000 (19:28 +0000)
Modules/_ssl.c

index 0008691181cea4acbb3c0a2f330bf69abda9e71f..7874c242103fe24a18aa2fc5be31a8ef574511c0 100644 (file)
@@ -1603,6 +1603,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
     PySSL_END_ALLOW_THREADS
     if (r != 1) {
         if (errno != 0) {
+            ERR_clear_error();
             PyErr_SetFromErrno(PyExc_IOError);
         }
         else {
@@ -1619,6 +1620,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
     Py_XDECREF(certfile_bytes);
     if (r != 1) {
         if (errno != 0) {
+            ERR_clear_error();
             PyErr_SetFromErrno(PyExc_IOError);
         }
         else {
@@ -1686,6 +1688,7 @@ load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwds)
     Py_XDECREF(capath_bytes);
     if (r != 1) {
         if (errno != 0) {
+            ERR_clear_error();
             PyErr_SetFromErrno(PyExc_IOError);
         }
         else {