mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-105927: Deprecate PyWeakref_GetObject() function (#106006)
Deprecate PyWeakref_GetObject() and PyWeakref_GET_OBJECT() functions.
This commit is contained in:
parent
dac3d389e7
commit
c075a1974b
7 changed files with 33 additions and 4 deletions
|
@ -3375,6 +3375,10 @@ error:
|
|||
static PyObject *
|
||||
test_weakref_capi(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
|
||||
{
|
||||
// Ignore PyWeakref_GetObject() deprecation, we test it on purpose
|
||||
_Py_COMP_DIAG_PUSH
|
||||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
||||
|
||||
// Create a new heap type, create an instance of this type, and delete the
|
||||
// type. This object supports weak references.
|
||||
PyObject *new_type = PyObject_CallFunction((PyObject*)&PyType_Type,
|
||||
|
@ -3463,6 +3467,8 @@ test_weakref_capi(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
|
|||
Py_DECREF(weakref);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
|
||||
_Py_COMP_DIAG_POP
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue