Skip to content

Commit 4219857

Browse files
bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) (GH-7651)
(cherry picked from commit 4531ec7) Co-authored-by: Ned Deily <nad@python.org>
1 parent a5db479 commit 4219857

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Lib/test/test_ssl.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4101,9 +4101,7 @@ def test_session_handling(self):
41014101
self.assertTrue(session)
41024102
with self.assertRaises(TypeError) as e:
41034103
s.session = object
4104-
self.assertEqual(
4105-
str(e.exception), 'Value is not an SSLSession.'
4106-
)
4104+
self.assertEqual(str(e.exception), 'Value is not a SSLSession.')
41074105

41084106
with client_context.wrap_socket(socket.socket(),
41094107
server_hostname=hostname) as s:

Modules/_ssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value,
20672067
SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
20682068
#endif
20692069
} else {
2070-
PyErr_SetString(PyExc_TypeError, "The value must be an SSLContext.");
2070+
PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext");
20712071
return -1;
20722072
}
20732073

@@ -2726,7 +2726,7 @@ static int PySSL_set_session(PySSLSocket *self, PyObject *value,
27262726
int result;
27272727

27282728
if (!PySSLSession_Check(value)) {
2729-
PyErr_SetString(PyExc_TypeError, "Value is not an SSLSession.");
2729+
PyErr_SetString(PyExc_TypeError, "Value is not a SSLSession.");
27302730
return -1;
27312731
}
27322732
pysess = (PySSLSession *)value;

0 commit comments

Comments
 (0)