mirror of
https://github.com/boostorg/python.git
synced 2026-01-22 17:32:55 +00:00
Bug fix -- we weren't handling NULL keywords dictionaries in raw_function
[SVN r19359]
This commit is contained in:
@@ -29,7 +29,10 @@ namespace detail
|
||||
{
|
||||
return incref(
|
||||
object(
|
||||
f(tuple(borrowed_reference(args)), dict(borrowed_reference(keywords)))
|
||||
f(
|
||||
tuple(borrowed_reference(args))
|
||||
, keywords ? dict(borrowed_reference(keywords)) : dict()
|
||||
)
|
||||
).ptr()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -90,3 +90,5 @@ BOOST_PYTHON_MODULE(args_ext)
|
||||
|
||||
def("inner", &X::inner, "docstring", args("self", "n"), return_internal_reference<>());
|
||||
}
|
||||
|
||||
#include "module_tail.cpp"
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
>>> raw(3, 4, foo = 'bar', baz = 42)
|
||||
((3, 4), {'foo': 'bar', 'baz': 42})
|
||||
|
||||
Prove that we can handle empty keywords and non-keywords
|
||||
|
||||
>>> raw(3, 4)
|
||||
((3, 4), {})
|
||||
|
||||
>>> raw(foo = 'bar')
|
||||
((), {'foo': 'bar'})
|
||||
|
||||
>>> f(x= 1, y = 3, z = 'hello')
|
||||
(1, 3.0, 'hello')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user