[Python-checkins] bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) (GH-7651)

Ned Deily webhook-mailer at python.org
Mon Jun 11 20:58:13 EDT 2018


https://github.com/python/cpython/commit/42198571c586e0dc56836b79329f94952b1975bb
commit: 42198571c586e0dc56836b79329f94952b1975bb
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ned Deily <nad at python.org>
date: 2018-06-11T20:58:06-04:00
summary:

bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) (GH-7651)

(cherry picked from commit 4531ec74c4a9c8e15ee2bdec11b12796ce000f6f)

Co-authored-by: Ned Deily <nad at python.org>

files:
M Lib/test/test_ssl.py
M Modules/_ssl.c

diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index b704b787157a..7bbaa9f1e8eb 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -4101,9 +4101,7 @@ def test_session_handling(self):
                 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 991b38aae628..bf379f01a1d2 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2067,7 +2067,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;
     }
 
@@ -2726,7 +2726,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;



More information about the Python-checkins mailing list