X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bindings%2Fpython%2Fbt2%2Fbt2%2Fquery_executor.py;h=a87713ff1c8a4f2c540fb35fabd81592cd910692;hb=0fd756a43bce605875565a14c1ed1b070fa3ad94;hp=f90bb902651cf5fb98c2b43bcab052c35068f250;hpb=601c002660cfc2434293a50a1bec418a6b41fdaf;p=babeltrace.git diff --git a/bindings/python/bt2/bt2/query_executor.py b/bindings/python/bt2/bt2/query_executor.py index f90bb902..a87713ff 100644 --- a/bindings/python/bt2/bt2/query_executor.py +++ b/bindings/python/bt2/bt2/query_executor.py @@ -26,8 +26,8 @@ import bt2 class QueryExecutor(object._SharedObject): - _get_ref = native_bt.query_executor_get_ref - _put_ref = native_bt.query_executor_put_ref + _get_ref = staticmethod(native_bt.query_executor_get_ref) + _put_ref = staticmethod(native_bt.query_executor_put_ref) def _handle_status(self, status, gen_error_msg): if status == native_bt.QUERY_EXECUTOR_STATUS_AGAIN: @@ -60,6 +60,9 @@ class QueryExecutor(object._SharedObject): return is_canceled > 0 def query(self, component_class, object, params=None): + if self.is_canceled: + raise bt2.QueryExecutorCanceled + if not isinstance(component_class, bt2.component._GenericComponentClass): err = False @@ -88,9 +91,3 @@ class QueryExecutor(object._SharedObject): self._handle_status(status, 'cannot query component class') assert(result_ptr) return bt2.value._create_from_ptr(result_ptr) - - def __eq__(self, other): - if type(other) is not type(self): - return False - - return self.addr == other.addr