mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
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.
This commit is contained in:
parent
be09bae608
commit
74b5e4ce80
1 changed files with 0 additions and 11 deletions
|
|
@ -3826,17 +3826,6 @@ class CReturnConverter(metaclass=CReturnConverterAutoRegister):
|
||||||
|
|
||||||
add_c_return_converter(CReturnConverter, 'object')
|
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):
|
class bool_return_converter(CReturnConverter):
|
||||||
type = 'int'
|
type = 'int'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue