Skip to content

Commit e6fd40b

Browse files
[3.12] gh-126455: Disallow _ssl.SSLSocket instantiation (GH-126481) (#126487)
gh-126455: Disallow _ssl.SSLSocket instantiation (GH-126481) Prevent creation of incomplete/invalid _ssl.SSLSocket objects when created directly. (cherry picked from commit b1c4ffc) Co-authored-by: Victor Stinner <[email protected]>
1 parent 7a4262b commit e6fd40b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_ssl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2900,7 +2900,7 @@ static PyType_Spec PySSLSocket_spec = {
29002900
.name = "_ssl._SSLSocket",
29012901
.basicsize = sizeof(PySSLSocket),
29022902
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
2903-
Py_TPFLAGS_HAVE_GC),
2903+
Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_DISALLOW_INSTANTIATION),
29042904
.slots = PySSLSocket_slots,
29052905
};
29062906

0 commit comments

Comments
 (0)