X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fgraph.py;fp=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fgraph.py;h=ef40014ba9262e58e678193e2b9355c59a92de27;hb=401b70220ef76fa7b420f6c6d55c2d5bdecb931c;hp=82708025c19032b91c72b063d977567b95ca4995;hpb=ce75de140f82187fdaabd19e74a90baa797b8980;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/graph.py b/src/bindings/python/bt2/bt2/graph.py index 82708025..ef40014b 100644 --- a/src/bindings/python/bt2/bt2/graph.py +++ b/src/bindings/python/bt2/bt2/graph.py @@ -129,7 +129,11 @@ class Graph(object._SharedObject): if obj is not None and not native_bt.bt2_is_python_component_class(base_cc_ptr): raise ValueError('cannot pass a Python object to a non-Python component') + if params is not None and not isinstance(params, (dict, bt2.MapValue)): + raise TypeError("'params' parameter is not a 'dict' or a 'bt2.MapValue'.") + params = bt2.create_value(params) + params_ptr = params._ptr if params is not None else None status, comp_ptr = add_fn(