summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-04-30 13:49:17 (GMT)
committerGitHub <noreply@github.com>2021-04-30 13:49:17 (GMT)
commit387397f8a4244c983f4568c16a28842e3268fe5d (patch)
tree6a2408e9fa59ca87cd9edeb958330041ca7b28aa /Modules
parent5979e81a212949c62c2490167c9137d233d7de64 (diff)
downloadcpython-387397f8a4244c983f4568c16a28842e3268fe5d.zip
cpython-387397f8a4244c983f4568c16a28842e3268fe5d.tar.gz
cpython-387397f8a4244c983f4568c16a28842e3268fe5d.tar.bz2
bpo-43916: select.poll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25750)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/selectmodule.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index f80da58..5038c32 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -728,13 +728,6 @@ newPollObject(PyObject *module)
return self;
}
-static PyObject *
-poll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
-{
- PyErr_Format(PyExc_TypeError, "Cannot create '%.200s' instances", _PyType_Name(type));
- return NULL;
-}
-
static void
poll_dealloc(pollObject *self)
{
@@ -2275,16 +2268,14 @@ static PyMethodDef poll_methods[] = {
static PyType_Slot poll_Type_slots[] = {
{Py_tp_dealloc, poll_dealloc},
{Py_tp_methods, poll_methods},
- {Py_tp_new, poll_new},
{0, 0},
};
static PyType_Spec poll_Type_spec = {
- "select.poll",
- sizeof(pollObject),
- 0,
- Py_TPFLAGS_DEFAULT,
- poll_Type_slots
+ .name = "select.poll",
+ .basicsize = sizeof(pollObject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ .slots = poll_Type_slots,
};
#ifdef HAVE_SYS_DEVPOLL_H