Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
topic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
/*[clinicinput] function->NoneType [clinicstartgeneratedcode]*/will produce this function:
staticPyObject*function(PyObject*module, PyObject*Py_UNUSED(ignored)){returnfunction_impl(module)}while function_impl returns Py_None (as it should, if using NoneType return converter), refcount is not increased.
here is a working example of NoneType return converter:
/*[clinicinput] function->NoneTypea: int/ [clinicstartgeneratedcode]*/staticPyObject*function(PyObject*module, PyObject*arg){PyObject*return_value=NULL; inta; PyObject*_return_value; a=_PyLong_AsInt(arg); if (a==-1&&PyErr_Occurred()){goto exit} _return_value=function_impl(module, a); if (_return_value!=Py_None){goto exit} return_value=Py_None; Py_INCREF(Py_None); exit: returnreturn_value}Generation also fails when generating a function with a single object parameter.
It seems like the problem is with default_return_converter in clinic.py, being set to True
hauntsaninja
Metadata
Metadata
Assignees
Labels
topic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error