Skip to content

Commit 4531ec7

Browse files
authored
bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650)
1 parent ef24b6c commit 4531ec7

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
@@ -4074,9 +4074,7 @@ def test_session_handling(self):
40744074
self.assertTrue(session)
40754075
with self.assertRaises(TypeError) as e:
40764076
s.session = object
4077-
self.assertEqual(
4078-
str(e.exception), 'Value is not an SSLSession.'
4079-
)
4077+
self.assertEqual(str(e.exception), 'Value is not a SSLSession.')
40804078

40814079
with client_context.wrap_socket(socket.socket(),
40824080
server_hostname=hostname) as s:

Modules/_ssl.c

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

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

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

0 commit comments

Comments
 (0)