summaryrefslogtreecommitdiffstats
path: root/Modules/_threadmodule.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-06 22:53:17 (GMT)
committerGitHub <noreply@github.com>2020-03-06 22:53:17 (GMT)
commit557287075c264d2458cd3e1b45e9b8ee5341e0a1 (patch)
tree6c34331fdbf74476b60b1e32972e360af4985ab6 /Modules/_threadmodule.c
parente59334ebc9308b0f3ad048ef293c6b49e6456d1a (diff)
downloadcpython-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/_threadmodule.c')
-rw-r--r--Modules/_threadmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index da5fe79..11bc16f 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -938,7 +938,7 @@ local_getattro(localobject *self, PyObject *name)
if (r == -1)
return NULL;
- if (Py_TYPE(self) != &localtype)
+ if (!Py_IS_TYPE(self, &localtype))
/* use generic lookup for subtypes */
return _PyObject_GenericGetAttrWithDict(
(PyObject *)self, name, ldict, 0);
@@ -1400,7 +1400,7 @@ static PyStructSequence_Desc ExceptHookArgs_desc = {
static PyObject *
thread_excepthook(PyObject *self, PyObject *args)
{
- if (Py_TYPE(args) != &ExceptHookArgsType) {
+ if (!Py_IS_TYPE(args, &ExceptHookArgsType)) {
PyErr_SetString(PyExc_TypeError,
"_thread.excepthook argument type "
"must be ExceptHookArgs");