bt2: Add `Const` suffix to `_Connection` class and adapt tests
[babeltrace.git] / src / bindings / python / bt2 / bt2 / graph.py
index 3812788f0b4bc05a9e2f08adbf8f82f76c8f2498..14c3b65b84f56fc2351455230e3e4edc2eddd08d 100644 (file)
@@ -70,8 +70,13 @@ class Graph(object._SharedObject):
     _get_ref = staticmethod(native_bt.graph_get_ref)
     _put_ref = staticmethod(native_bt.graph_put_ref)
 
-    def __init__(self):
-        ptr = native_bt.graph_create()
+    def __init__(self, mip_version=0):
+        utils._check_uint64(mip_version)
+
+        if mip_version > bt2.get_maximal_mip_version():
+            raise ValueError('unknown MIP version {}'.format(mip_version))
+
+        ptr = native_bt.graph_create(mip_version)
 
         if ptr is None:
             raise bt2._MemoryError('cannot create graph object')
@@ -142,7 +147,7 @@ class Graph(object._SharedObject):
         )
         utils._handle_func_status(status, 'cannot connect component ports within graph')
         assert conn_ptr
-        return bt2_connection._Connection._create_from_ptr(conn_ptr)
+        return bt2_connection._ConnectionConst._create_from_ptr(conn_ptr)
 
     def add_port_added_listener(self, listener):
         if not callable(listener):
This page took 0.024067 seconds and 4 git commands to generate.