mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
bpo-35452: Make PySys_HasWarnOptions() never raising an exception. (GH-11075)
This commit is contained in:
parent
cf247359d5
commit
dffccc6b59
1 changed files with 2 additions and 1 deletions
|
@ -1845,7 +1845,8 @@ int
|
||||||
PySys_HasWarnOptions(void)
|
PySys_HasWarnOptions(void)
|
||||||
{
|
{
|
||||||
PyObject *warnoptions = _PySys_GetObjectId(&PyId_warnoptions);
|
PyObject *warnoptions = _PySys_GetObjectId(&PyId_warnoptions);
|
||||||
return (warnoptions != NULL && (PyList_Size(warnoptions) > 0)) ? 1 : 0;
|
return (warnoptions != NULL && PyList_Check(warnoptions)
|
||||||
|
&& PyList_GET_SIZE(warnoptions) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue