2015-04-03 17:53:51 -03:00
|
|
|
/*[clinic input]
|
|
|
|
preserve
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
PyDoc_STRVAR(_weakref_getweakrefcount__doc__,
|
|
|
|
"getweakrefcount($module, object, /)\n"
|
|
|
|
"--\n"
|
|
|
|
"\n"
|
|
|
|
"Return the number of weak references to \'object\'.");
|
|
|
|
|
|
|
|
#define _WEAKREF_GETWEAKREFCOUNT_METHODDEF \
|
|
|
|
{"getweakrefcount", (PyCFunction)_weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__},
|
|
|
|
|
|
|
|
static Py_ssize_t
|
|
|
|
_weakref_getweakrefcount_impl(PyModuleDef *module, PyObject *object);
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
_weakref_getweakrefcount(PyModuleDef *module, PyObject *object)
|
|
|
|
{
|
|
|
|
PyObject *return_value = NULL;
|
|
|
|
Py_ssize_t _return_value;
|
|
|
|
|
|
|
|
_return_value = _weakref_getweakrefcount_impl(module, object);
|
2016-06-09 10:16:06 -03:00
|
|
|
if ((_return_value == -1) && PyErr_Occurred()) {
|
2015-04-03 17:53:51 -03:00
|
|
|
goto exit;
|
2016-06-09 10:16:06 -03:00
|
|
|
}
|
2015-04-03 17:53:51 -03:00
|
|
|
return_value = PyLong_FromSsize_t(_return_value);
|
|
|
|
|
|
|
|
exit:
|
|
|
|
return return_value;
|
|
|
|
}
|
2016-06-09 10:16:06 -03:00
|
|
|
/*[clinic end generated code: output=00e317cda5359ea3 input=a9049054013a1b77]*/
|