summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-27 02:00:55 (GMT)
committerGitHub <noreply@github.com>2022-01-27 02:00:55 (GMT)
commitaf32b3ef1fbad3c2242627a14398320960a0cb45 (patch)
tree350016f513e2ebbdae51ee1e033f668dc2d3f609 /Objects/exceptions.c
parentf0a648152f2d8011f47cc49873438ebaf01d3f82 (diff)
downloadcpython-af32b3ef1fbad3c2242627a14398320960a0cb45.zip
cpython-af32b3ef1fbad3c2242627a14398320960a0cb45.tar.gz
cpython-af32b3ef1fbad3c2242627a14398320960a0cb45.tar.bz2
bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)
Convert the PyType_SUPPORTS_WEAKREFS() macro to a regular function. It no longer access the PyTypeObject.tp_weaklistoffset member directly. Add _PyType_SUPPORTS_WEAKREFS() static inline functions, used internally by Python for best performance.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index d8bfb31..ea8a310 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -3729,7 +3729,7 @@ _PyErr_TrySetFromCause(const char *format, ...)
base_exc_size = _PyExc_BaseException.tp_basicsize;
same_basic_size = (
caught_type_size == base_exc_size ||
- (PyType_SUPPORTS_WEAKREFS(caught_type) &&
+ (_PyType_SUPPORTS_WEAKREFS(caught_type) &&
(caught_type_size == base_exc_size + (Py_ssize_t)sizeof(PyObject *))
)
);