mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
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.
This commit is contained in:
parent
b6be18812c
commit
513c89d012
3 changed files with 136 additions and 73 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue