diff options
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index f7690b1..d16b1b4 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -997,13 +997,13 @@ builtin_getattr(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *v, *result, *dflt = NULL; PyObject *name; - if (!_PyArg_UnpackStack(args, nargs, "getattr", 2, 3, &v, &name, &dflt)) - return NULL; - if (!_PyArg_NoStackKeywords("getattr", kwnames)) { return NULL; } + if (!_PyArg_UnpackStack(args, nargs, "getattr", 2, 3, &v, &name, &dflt)) + return NULL; + if (!PyUnicode_Check(name)) { PyErr_SetString(PyExc_TypeError, "getattr(): attribute name must be string"); @@ -1307,13 +1307,13 @@ builtin_next(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *it, *res; PyObject *def = NULL; - if (!_PyArg_UnpackStack(args, nargs, "next", 1, 2, &it, &def)) - return NULL; - if (!_PyArg_NoStackKeywords("next", kwnames)) { return NULL; } + if (!_PyArg_UnpackStack(args, nargs, "next", 1, 2, &it, &def)) + return NULL; + if (!PyIter_Check(it)) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not an iterator", |