Mercurial > cpython-lru_cache-weakref
diff Objects/methodobject.c @ 43177:b7bfa780a882
Get rid of METH_OLDARGS.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sat, 01 Sep 2007 13:59:50 +0000 |
| parents | 42b39cb536d9 |
| children | 483e958d13c7 |
line wrap: on
line diff
--- a/Objects/methodobject.c Sat Sep 01 13:51:09 2007 +0000 +++ b/Objects/methodobject.c Sat Sep 01 13:59:50 2007 +0000 @@ -73,7 +73,6 @@ return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: - case METH_OLDARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (kw == NULL || PyDict_Size(kw) == 0) { @@ -97,19 +96,11 @@ return NULL; } break; - case METH_OLDARGS: - /* the really old style */ - if (kw == NULL || PyDict_Size(kw) == 0) { - size = PyTuple_GET_SIZE(arg); - if (size == 1) - arg = PyTuple_GET_ITEM(arg, 0); - else if (size == 0) - arg = NULL; - return (*meth)(self, arg); - } - break; default: - PyErr_BadInternalCall(); + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "PyCFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
