diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-06 12:07:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 12:07:02 (GMT) |
commit | 38aefc585f60a77d66f4fbe5a37594a488b53474 (patch) | |
tree | 142fb1765e421b36ee746a6a5f53b0d52161b2c2 /Modules/_weakref.c | |
parent | 08050e959e6c40839cd2c9e5f6a4fd1513e3d605 (diff) | |
download | cpython-38aefc585f60a77d66f4fbe5a37594a488b53474.zip cpython-38aefc585f60a77d66f4fbe5a37594a488b53474.tar.gz cpython-38aefc585f60a77d66f4fbe5a37594a488b53474.tar.bz2 |
bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)
Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to
hide implementation details: the macro accessed directly to the
PyTypeObject.tp_weaklistoffset member.
Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the
internal C API.
Diffstat (limited to 'Modules/_weakref.c')
-rw-r--r-- | Modules/_weakref.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_weakref.c b/Modules/_weakref.c index cd7c4c1..e33cba2 100644 --- a/Modules/_weakref.c +++ b/Modules/_weakref.c @@ -1,8 +1,9 @@ #include "Python.h" +#include "pycore_object.h" // _PyObject_GET_WEAKREFS_LISTPTR #define GET_WEAKREFS_LISTPTR(o) \ - ((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o)) + ((PyWeakReference **) _PyObject_GET_WEAKREFS_LISTPTR(o)) /*[clinic input] module _weakref |