summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-09-23 12:08:38 (GMT)
committerGitHub <noreply@github.com>2020-09-23 12:08:38 (GMT)
commit97d15ae1d8411b49b1fcdc0c67c51849dccce9c9 (patch)
tree9418f79ebdc807c61273226dfc8b701a152bdb26 /Modules/_io
parentb7d8d8dbfe83040087a63662e0b908f4b5ac24b0 (diff)
downloadcpython-97d15ae1d8411b49b1fcdc0c67c51849dccce9c9.zip
cpython-97d15ae1d8411b49b1fcdc0c67c51849dccce9c9.tar.gz
cpython-97d15ae1d8411b49b1fcdc0c67c51849dccce9c9.tar.bz2
bpo-40170: Use inline _PyType_HasFeature() function (GH-22375)
Use _PyType_HasFeature() in the _io module and in structseq implementation. Replace PyType_HasFeature() opaque function call with _PyType_HasFeature() inlined function.
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/iobase.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index a8e55c3..195862d 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -349,8 +349,9 @@ iobase_dealloc(iobase *self)
if (_PyIOBase_finalize((PyObject *) self) < 0) {
/* When called from a heap type's dealloc, the type will be
decref'ed on return (see e.g. subtype_dealloc in typeobject.c). */
- if (PyType_HasFeature(Py_TYPE(self), Py_TPFLAGS_HEAPTYPE))
+ if (_PyType_HasFeature(Py_TYPE(self), Py_TPFLAGS_HEAPTYPE)) {
Py_INCREF(Py_TYPE(self));
+ }
return;
}
_PyObject_GC_UNTRACK(self);