mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-15999: Accept arbitrary values for boolean parameters. (#15609)
builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
This commit is contained in:
parent
c68573b339
commit
a87c46eab3
52 changed files with 297 additions and 302 deletions
|
@ -270,7 +270,7 @@ faulthandler_dump_traceback_py(PyObject *self,
|
|||
int fd;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"|Oi:dump_traceback", kwlist,
|
||||
"|Op:dump_traceback", kwlist,
|
||||
&file, &all_threads))
|
||||
return NULL;
|
||||
|
||||
|
@ -546,7 +546,7 @@ faulthandler_py_enable(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
PyThreadState *tstate;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"|Oi:enable", kwlist, &file, &all_threads))
|
||||
"|Op:enable", kwlist, &file, &all_threads))
|
||||
return NULL;
|
||||
|
||||
fd = faulthandler_get_fileno(&file);
|
||||
|
@ -916,7 +916,7 @@ faulthandler_register_py(PyObject *self,
|
|||
int err;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"i|Oii:register", kwlist,
|
||||
"i|Opp:register", kwlist,
|
||||
&signum, &file, &all_threads, &chain))
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue