mirror of
https://github.com/python/cpython.git
synced 2025-12-02 23:57:43 +00:00
Revert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303)" (#136991)
This commit is contained in:
parent
b31e5d6de1
commit
3a89dfe32b
12 changed files with 144 additions and 322 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue