summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorscoder <stefan_ml@behnel.de>2020-05-12 14:12:41 (GMT)
committerGitHub <noreply@github.com>2020-05-12 14:12:41 (GMT)
commit4c9ea093cd752a6687864674d34250653653f743 (patch)
tree1e20a7880c4054f345d7ab39a1835193baed83dd /Objects/abstract.c
parent5650e76f63a6f4ec55d00ec13f143d84a2efee39 (diff)
downloadcpython-4c9ea093cd752a6687864674d34250653653f743.zip
cpython-4c9ea093cd752a6687864674d34250653653f743.tar.gz
cpython-4c9ea093cd752a6687864674d34250653653f743.tar.bz2
bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (GH-20024)
… now that we allow subtypes of PyCFunction. Also add PyCMethod_CheckExact() and PyCMethod_Check() for checks against the PyCMethod subtype.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index b014f79..5b85b01 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -900,7 +900,7 @@ binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name)
Py_DECREF(result);
if (op_slot == NB_SLOT(nb_rshift) &&
- PyCFunction_Check(v) &&
+ PyCFunction_CheckExact(v) &&
strcmp(((PyCFunctionObject *)v)->m_ml->ml_name, "print") == 0)
{
PyErr_Format(PyExc_TypeError,