Revert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303)" (#136991)

This commit is contained in:
Serhiy Storchaka 2025-07-22 16:39:50 +03:00 committed by GitHub
parent b31e5d6de1
commit 3a89dfe32b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 144 additions and 322 deletions

View file

@ -1415,11 +1415,14 @@ interp_get_config(PyObject *self, PyObject *args, PyObject *kwds)
PyObject *idobj = NULL;
int restricted = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O?|$p:get_config", kwlist,
"O|$p:get_config", kwlist,
&idobj, &restricted))
{
return NULL;
}
if (idobj == Py_None) {
idobj = NULL;
}
int reqready = 0;
PyInterpreterState *interp = \
@ -1536,14 +1539,14 @@ capture_exception(PyObject *self, PyObject *args, PyObject *kwds)
static char *kwlist[] = {"exc", NULL};
PyObject *exc_arg = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|O?:capture_exception", kwlist,
"|O:capture_exception", kwlist,
&exc_arg))
{
return NULL;
}
PyObject *exc = exc_arg;
if (exc == NULL) {
if (exc == NULL || exc == Py_None) {
exc = PyErr_GetRaisedException();
if (exc == NULL) {
Py_RETURN_NONE;