diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Modules/_weakref.c | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/_weakref.c')
-rw-r--r-- | contrib/tools/python3/src/Modules/_weakref.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/contrib/tools/python3/src/Modules/_weakref.c b/contrib/tools/python3/src/Modules/_weakref.c index be3ac6dae1..e33cba2a3d 100644 --- a/contrib/tools/python3/src/Modules/_weakref.c +++ b/contrib/tools/python3/src/Modules/_weakref.c @@ -1,9 +1,9 @@ #include "Python.h" -#include "pycore_object.h" // _PyObject_GET_WEAKREFS_LISTPTR +#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 @@ -137,48 +137,48 @@ weakref_functions[] = { {NULL, NULL, 0, NULL} }; -static int -weakref_exec(PyObject *module) -{ - Py_INCREF(&_PyWeakref_RefType); - if (PyModule_AddObject(module, "ref", (PyObject *) &_PyWeakref_RefType) < 0) { - Py_DECREF(&_PyWeakref_RefType); - return -1; - } - Py_INCREF(&_PyWeakref_RefType); - if (PyModule_AddObject(module, "ReferenceType", - (PyObject *) &_PyWeakref_RefType) < 0) { - Py_DECREF(&_PyWeakref_RefType); - return -1; - } - Py_INCREF(&_PyWeakref_ProxyType); - if (PyModule_AddObject(module, "ProxyType", - (PyObject *) &_PyWeakref_ProxyType) < 0) { - Py_DECREF(&_PyWeakref_ProxyType); - return -1; - } - Py_INCREF(&_PyWeakref_CallableProxyType); - if (PyModule_AddObject(module, "CallableProxyType", - (PyObject *) &_PyWeakref_CallableProxyType) < 0) { - Py_DECREF(&_PyWeakref_CallableProxyType); - return -1; - } - - return 0; -} - -static struct PyModuleDef_Slot weakref_slots[] = { - {Py_mod_exec, weakref_exec}, - {0, NULL} -}; - +static int +weakref_exec(PyObject *module) +{ + Py_INCREF(&_PyWeakref_RefType); + if (PyModule_AddObject(module, "ref", (PyObject *) &_PyWeakref_RefType) < 0) { + Py_DECREF(&_PyWeakref_RefType); + return -1; + } + Py_INCREF(&_PyWeakref_RefType); + if (PyModule_AddObject(module, "ReferenceType", + (PyObject *) &_PyWeakref_RefType) < 0) { + Py_DECREF(&_PyWeakref_RefType); + return -1; + } + Py_INCREF(&_PyWeakref_ProxyType); + if (PyModule_AddObject(module, "ProxyType", + (PyObject *) &_PyWeakref_ProxyType) < 0) { + Py_DECREF(&_PyWeakref_ProxyType); + return -1; + } + Py_INCREF(&_PyWeakref_CallableProxyType); + if (PyModule_AddObject(module, "CallableProxyType", + (PyObject *) &_PyWeakref_CallableProxyType) < 0) { + Py_DECREF(&_PyWeakref_CallableProxyType); + return -1; + } + + return 0; +} + +static struct PyModuleDef_Slot weakref_slots[] = { + {Py_mod_exec, weakref_exec}, + {0, NULL} +}; + static struct PyModuleDef weakrefmodule = { PyModuleDef_HEAD_INIT, "_weakref", "Weak-reference support module.", - 0, + 0, weakref_functions, - weakref_slots, + weakref_slots, NULL, NULL, NULL @@ -187,5 +187,5 @@ static struct PyModuleDef weakrefmodule = { PyMODINIT_FUNC PyInit__weakref(void) { - return PyModuleDef_Init(&weakrefmodule); + return PyModuleDef_Init(&weakrefmodule); } |