mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
e59334ebc9
commit
557287075c
10 changed files with 15 additions and 17 deletions
|
|
@ -6380,8 +6380,7 @@ convert_sched_param(PyObject *param, struct sched_param *res)
|
|||
{
|
||||
long priority;
|
||||
|
||||
PyObject *SchedParamType = _posixstate_global->SchedParamType;
|
||||
if (Py_TYPE(param) != (PyTypeObject *)SchedParamType) {
|
||||
if (!Py_IS_TYPE(param, (PyTypeObject *)_posixstate_global->SchedParamType)) {
|
||||
PyErr_SetString(PyExc_TypeError, "must have a sched_param object");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue