From 74b5e4ce80858ac5c7d03411cb8cce7e6865f181 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 20 Jul 2022 08:42:02 +0300 Subject: [PATCH] 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. --- Tools/clinic/clinic.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 0041363c46b..36bfc705050 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -3826,17 +3826,6 @@ def render(self, function, data): 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'