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=6c9db7ec96a24b4e97d4b44c993fc2c2a6100514;hb=056deb59eb33e87c06c0067907768ab08aff74a2;hp=3812788f0b4bc05a9e2f08adbf8f82f76c8f2498;hpb=f1f741737f03892d781ed00de554606eeea84c15;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/graph.py b/src/bindings/python/bt2/bt2/graph.py index 3812788f..6c9db7ec 100644 --- a/src/bindings/python/bt2/bt2/graph.py +++ b/src/bindings/python/bt2/bt2/graph.py @@ -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')