Unverified Kaydet (Commit) dffccc6b authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka Kaydeden (comit) GitHub

bpo-35452: Make PySys_HasWarnOptions() never raising an exception. (GH-11075)

üst cf247359
......@@ -1845,7 +1845,8 @@ int
PySys_HasWarnOptions(void)
{
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 *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment