diff options
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 7354183..76c9f87 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -507,7 +507,8 @@ filter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyObject *it; filterobject *lz; - if (type == &PyFilter_Type && !_PyArg_NoKeywords("filter", kwds)) + if ((type == &PyFilter_Type || type->tp_init == PyFilter_Type.tp_init) && + !_PyArg_NoKeywords("filter", kwds)) return NULL; if (!PyArg_UnpackTuple(args, "filter", 2, 2, &func, &seq)) @@ -1218,7 +1219,8 @@ map_new(PyTypeObject *type, PyObject *args, PyObject *kwds) mapobject *lz; Py_ssize_t numargs, i; - if (type == &PyMap_Type && !_PyArg_NoKeywords("map", kwds)) + if ((type == &PyMap_Type || type->tp_init == PyMap_Type.tp_init) && + !_PyArg_NoKeywords("map", kwds)) return NULL; numargs = PyTuple_Size(args); |