aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Modules/_weakref.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Modules/_weakref.c
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/_weakref.c')
-rw-r--r--contrib/tools/python3/src/Modules/_weakref.c80
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 e33cba2a3d..be3ac6dae1 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);
}