]> granicus.if.org Git - python/commitdiff
bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) (GH-7651)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 12 Jun 2018 00:58:06 +0000 (17:58 -0700)
committerNed Deily <nad@python.org>
Tue, 12 Jun 2018 00:58:06 +0000 (20:58 -0400)
(cherry picked from commit 4531ec74c4a9c8e15ee2bdec11b12796ce000f6f)

Co-authored-by: Ned Deily <nad@python.org>
Lib/test/test_ssl.py
Modules/_ssl.c

index b704b787157acc96e8b7a0cd0a10a7b94e6516b3..7bbaa9f1e8eb9b8c6760fa3cacb48ea06df9f2d7 100644 (file)
@@ -4101,9 +4101,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:
index 991b38aae628b34db7fd2ee1f4e49069e7426037..bf379f01a1d2bf5d418848bf0f432279cb8c7b59 100644 (file)
@@ -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;