diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 5223e21b5cdb11f..b6b5ebf094c938a 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2979,7 +2979,7 @@ static PyType_Spec PySSLSocket_spec = { .name = "_ssl._SSLSocket", .basicsize = sizeof(PySSLSocket), .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE | - Py_TPFLAGS_HAVE_GC), + Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_DISALLOW_INSTANTIATION), .slots = PySSLSocket_slots, };