From: Serhiy Storchaka Date: Wed, 20 Jul 2022 05:42:02 +0000 (+0300) Subject: gh-95007: Remove the NoneType return converter (GH-95019) X-Git-Tag: v3.12.0a1~913 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74b5e4ce80858ac5c7d03411cb8cce7e6865f181;p=thirdparty%2FPython%2Fcpython.git gh-95007: Remove the NoneType return converter (GH-95019) It has confusing semantic which does not provide any benefit (the only difference is that you should write "return Py_None" instead of "Py_RETURN_NONE"), it is not currently used, and it is broken. --- diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 0041363c46be..36bfc7050507 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -3826,17 +3826,6 @@ class CReturnConverter(metaclass=CReturnConverterAutoRegister): add_c_return_converter(CReturnConverter, 'object') -class NoneType_return_converter(CReturnConverter): - def render(self, function, data): - self.declare(data) - data.return_conversion.append(''' -if (_return_value != Py_None) { - goto exit; -} -return_value = Py_None; -Py_INCREF(Py_None); -'''.strip()) - class bool_return_converter(CReturnConverter): type = 'int'