diff options
author | Andy Lester <andy@petdance.com> | 2020-03-06 22:53:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-06 22:53:17 (GMT) |
commit | 557287075c264d2458cd3e1b45e9b8ee5341e0a1 (patch) | |
tree | 6c34331fdbf74476b60b1e32972e360af4985ab6 /Modules/posixmodule.c | |
parent | e59334ebc9308b0f3ad048ef293c6b49e6456d1a (diff) | |
download | cpython-557287075c264d2458cd3e1b45e9b8ee5341e0a1.zip cpython-557287075c264d2458cd3e1b45e9b8ee5341e0a1.tar.gz cpython-557287075c264d2458cd3e1b45e9b8ee5341e0a1.tar.bz2 |
bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4d6d255..29aeca4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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; } |