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') super().__init__(ptr)
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') super().__init__(ptr) # list of listener partials to keep a reference as long as # this graph exists self._listener_partials = []
def test_get_maximal_mip_version(self): self.assertEqual(bt2.get_maximal_mip_version(), 0)