summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-23 22:19:11 (GMT)
committerGitHub <noreply@github.com>2023-08-23 22:19:11 (GMT)
commit513c89d0122ff6245cfefbb49ef32bde8a2336f5 (patch)
tree4d2b87216c371ec4a2c7e318355698446e33295f /Include
parentb6be18812c68fce5ab56c266dc5fc5a3cceb09c0 (diff)
downloadcpython-513c89d0122ff6245cfefbb49ef32bde8a2336f5.zip
cpython-513c89d0122ff6245cfefbb49ef32bde8a2336f5.tar.gz
cpython-513c89d0122ff6245cfefbb49ef32bde8a2336f5.tar.bz2
gh-108240: Add _PyCapsule_SetTraverse() internal function (#108339)
The _socket extension uses _PyCapsule_SetTraverse() to visit and clear the socket type in the garbage collector. So the _socket.socket type can be cleared in some corner cases when it wasn't possible before.
Diffstat (limited to 'Include')
-rw-r--r--Include/pycapsule.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/pycapsule.h b/Include/pycapsule.h
index 929a9a6..8660e83 100644
--- a/Include/pycapsule.h
+++ b/Include/pycapsule.h
@@ -48,6 +48,10 @@ PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);
PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
+#ifdef Py_BUILD_CORE
+PyAPI_FUNC(int) _PyCapsule_SetTraverse(PyObject *op, traverseproc traverse_func, inquiry clear_func);
+#endif
+
PyAPI_FUNC(void *) PyCapsule_Import(
const char *name, /* UTF-8 encoded string */
int no_block);