Skip to content

Commit

Permalink
gh-95007: Remove the NoneType return converter (GH-95019)
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 authored Jul 20, 2022
1 parent be09bae commit 74b5e4c
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 74b5e4c

Please sign in to comment.