From: Ned Deily Date: Tue, 12 Jun 2018 00:26:28 +0000 (-0400) Subject: bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) X-Git-Tag: v3.8.0a1~1578 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4531ec74c4a9c8e15ee2bdec11b12796ce000f6f;p=thirdparty%2FPython%2Fcpython.git bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) --- diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 3d6ae0298d02..73d3e3bbcdae 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4074,9 +4074,7 @@ class ThreadedTests(unittest.TestCase): self.assertTrue(session) with self.assertRaises(TypeError) as e: s.session = object - self.assertEqual( - str(e.exception), 'Value is not an SSLSession.' - ) + self.assertEqual(str(e.exception), 'Value is not a SSLSession.') with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 00d648d8a93a..2bce4816d26f 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2066,7 +2066,7 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value, SSL_set_SSL_CTX(self->ssl, self->ctx->ctx); #endif } else { - PyErr_SetString(PyExc_TypeError, "The value must be an SSLContext."); + PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext"); return -1; } @@ -2725,7 +2725,7 @@ static int PySSL_set_session(PySSLSocket *self, PyObject *value, int result; if (!PySSLSession_Check(value)) { - PyErr_SetString(PyExc_TypeError, "Value is not an SSLSession."); + PyErr_SetString(PyExc_TypeError, "Value is not a SSLSession."); return -1; } pysess = (PySSLSession *)value;