2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 05:22:45 +00:00

Bug fix: convertability checks were missed in one case

[SVN r12233]
This commit is contained in:
Dave Abrahams
2002-01-06 14:39:52 +00:00
parent d598d0a4db
commit 03fef3106d

View File

@@ -84,29 +84,23 @@ free_function = '''%{ template <%(class A%n%:, %)>
%}%( unwrap%{_more%}<A%n> c%n(PyTuple_GET_ITEM(args, %n)%{, c%-%});
%)%[r%:
// find the result converter
wrap%{_more%}<R> r%{(c%-)%};%]%{
if (!c0) return 0;%}
%[r%:return r( %](*pf)(%(*c%n%:, %))%[r%: )%];%[v%:
wrap%{_more%}<R> c%n%{(c%-)%};%]%[not-void-and-0-arg%:
if (!c0) return 0;%]
%[r%:return c%n( %](*pf)(%(*c%n%:, %))%[r%: )%];%[v%:
return detail::none();%]
}
'''
def _returns_value(key, n, args, value):
if key == 'r':
if key != 'v':
return value
# pass the value through gen_function again for recursive expansion
# return apply(gen_function, (value, n) + args
# , {'fill': _returns_value})
else:
assert key == 'v'
return ''
def _returns_void(key, n, args, value):
if key == 'v':
if key == 'v' or key == 'not-void-and-0-arg' and n != 0:
return value
else:
assert key == 'r'
# return the empty string, ignoring the value
return ''
_cv_qualifiers = ('', ' const', ' volatile', ' const volatile')