Skip to content

Commit

Permalink
pythongh-95007: Remove the NoneType return converter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
serhiy-storchaka committed Jul 19, 2022
1 parent 49aeff4 commit f7cbbe7
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit f7cbbe7

Please sign in to comment.