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(
def run(self):
status = native_bt.graph_run(self._ptr)
-
- try:
- utils._handle_func_status(status, 'graph object stopped running')
- except bt2.Stop:
- # done
- return
- except Exception:
- raise
+ utils._handle_func_status(status, 'graph object stopped running')
def add_interrupter(self, interrupter):
utils._check_type(interrupter, bt2_interrupter.Interrupter)