#define WINREG_HKEYTYPE___ENTER___METHODDEF \
{"__enter__", (PyCFunction)winreg_HKEYType___enter__, METH_NOARGS, winreg_HKEYType___enter____doc__},
-static PyHKEYObject *
+static PyObject *
winreg_HKEYType___enter___impl(PyHKEYObject *self);
static PyObject *
winreg_HKEYType___enter__(PyObject *self, PyObject *Py_UNUSED(ignored))
{
- PyObject *return_value = NULL;
- PyHKEYObject *_return_value;
-
- _return_value = winreg_HKEYType___enter___impl((PyHKEYObject *)self);
- return_value = (PyObject *)_return_value;
-
- return return_value;
+ return winreg_HKEYType___enter___impl((PyHKEYObject *)self);
}
#endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) */
#ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF
#define WINREG_QUERYREFLECTIONKEY_METHODDEF
#endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */
-/*[clinic end generated code: output=ce7e8e38884851fb input=a9049054013a1b77]*/
+/*[clinic end generated code: output=97295995db2c24e9 input=a9049054013a1b77]*/
self.err_occurred_if_null_pointer("_return_value", data)
data.return_conversion.append(
'return_value = PyHKEY_FromHKEY(_PyModule_GetState(module), _return_value);\n')
-
-# HACK: this only works for PyHKEYObjects, nothing else.
-# Should this be generalized and enshrined in clinic.py,
-# destroy this converter with prejudice.
-class self_return_converter(CReturnConverter):
- type = 'PyHKEYObject *'
-
- def render(self, function, data):
- self.declare(data)
- data.return_conversion.append(
- 'return_value = (PyObject *)_return_value;\n')
[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=4979f33998ffb6f8]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=b34c8217647f5fef]*/
#include "clinic/winreg.c.h"
}
/*[clinic input]
-winreg.HKEYType.__enter__ -> self
+winreg.HKEYType.__enter__
[clinic start generated code]*/
-static PyHKEYObject *
+static PyObject *
winreg_HKEYType___enter___impl(PyHKEYObject *self)
-/*[clinic end generated code: output=52c34986dab28990 input=c40fab1f0690a8e2]*/
+/*[clinic end generated code: output=70ec10933068a08c input=85f6abf60774c88c]*/
{
- return (PyHKEYObject*)Py_XNewRef(self);
+ return Py_XNewRef(self);
}