summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-04-30 16:19:57 (GMT)
committerGitHub <noreply@github.com>2021-04-30 16:19:57 (GMT)
commit7dcf0f6db38b7ab6918608542d3a0c6da0a286af (patch)
tree3b74a0dd47b013cdec2258c2c714ffa4103351e4 /Modules
parent9746cda705decebc0ba572d95612796afd06dcd4 (diff)
downloadcpython-7dcf0f6db38b7ab6918608542d3a0c6da0a286af.zip
cpython-7dcf0f6db38b7ab6918608542d3a0c6da0a286af.tar.gz
cpython-7dcf0f6db38b7ab6918608542d3a0c6da0a286af.tar.bz2
bpo-43916: select.devpoll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25751)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/selectmodule.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 5038c32..3ecd0c3 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -1110,13 +1110,6 @@ newDevPollObject(PyObject *module)
return self;
}
-static PyObject *
-devpoll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
-{
- PyErr_Format(PyExc_TypeError, "Cannot create '%.200s' instances", _PyType_Name(type));
- return NULL;
-}
-
static void
devpoll_dealloc(devpollObject *self)
{
@@ -1131,7 +1124,6 @@ static PyType_Slot devpoll_Type_slots[] = {
{Py_tp_dealloc, devpoll_dealloc},
{Py_tp_getset, devpoll_getsetlist},
{Py_tp_methods, devpoll_methods},
- {Py_tp_new, devpoll_new},
{0, 0},
};
@@ -1139,7 +1131,7 @@ static PyType_Spec devpoll_Type_spec = {
"select.devpoll",
sizeof(devpollObject),
0,
- Py_TPFLAGS_DEFAULT,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
devpoll_Type_slots
};