Skip to content

Commit 4c80b06

Browse files
committed
Remove duplicate function
1 parent 3ada298 commit 4c80b06

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

Modules/posixmodule.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12473,7 +12473,7 @@ typedef struct {
1247312473
} DirEntry;
1247412474

1247512475
static PyObject *
12476-
DirEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12476+
_disabled_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1247712477
{
1247812478
PyErr_Format(PyExc_TypeError,
1247912479
"cannot create '%.100s' instances", _PyType_Name(type));
@@ -12789,7 +12789,7 @@ static PyMethodDef DirEntry_methods[] = {
1278912789
};
1279012790

1279112791
static PyType_Slot DirEntryType_slots[] = {
12792-
{Py_tp_new, DirEntry_new},
12792+
{Py_tp_new, _disabled_new},
1279312793
{Py_tp_dealloc, DirEntry_dealloc},
1279412794
{Py_tp_repr, DirEntry_repr},
1279512795
{Py_tp_methods, DirEntry_methods},
@@ -13197,14 +13197,6 @@ ScandirIterator_finalize(ScandirIterator *iterator)
1319713197
PyErr_Restore(error_type, error_value, error_traceback);
1319813198
}
1319913199

13200-
static PyObject *
13201-
ScandirIterator_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13202-
{
13203-
PyErr_Format(PyExc_TypeError,
13204-
"cannot create '%.100s' instances", _PyType_Name(type));
13205-
return NULL;
13206-
}
13207-
1320813200
static void
1320913201
ScandirIterator_dealloc(ScandirIterator *iterator)
1321013202
{
@@ -13224,7 +13216,7 @@ static PyMethodDef ScandirIterator_methods[] = {
1322413216
};
1322513217

1322613218
static PyType_Slot ScandirIteratorType_slots[] = {
13227-
{Py_tp_new, ScandirIterator_new},
13219+
{Py_tp_new, _disabled_new},
1322813220
{Py_tp_dealloc, ScandirIterator_dealloc},
1322913221
{Py_tp_finalize, ScandirIterator_finalize},
1323013222
{Py_tp_iter, PyObject_SelfIter},

0 commit comments

Comments
 (0)