X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Finterrupter.py;h=b926b45e7a0e1af4c81f945d35eae83dde0a4c65;hb=c345b07873b0cb0ed344bde32a322a1b1edf60ae;hp=539f99909cadb7a91dbef7dcb8d9bb89c06ec439;hpb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/interrupter.py b/src/bindings/python/bt2/bt2/interrupter.py index 539f9990..b926b45e 100644 --- a/src/bindings/python/bt2/bt2/interrupter.py +++ b/src/bindings/python/bt2/bt2/interrupter.py @@ -2,19 +2,25 @@ # # Copyright (c) 2019 Philippe Proulx -from bt2 import native_bt, object -import bt2 +from bt2 import native_bt +from bt2 import object as bt2_object +from bt2 import error as bt2_error -class Interrupter(object._SharedObject): - _get_ref = staticmethod(native_bt.interrupter_get_ref) - _put_ref = staticmethod(native_bt.interrupter_put_ref) +class Interrupter(bt2_object._SharedObject): + @staticmethod + def _get_ref(ptr): + native_bt.interrupter_get_ref(ptr) + + @staticmethod + def _put_ref(ptr): + native_bt.interrupter_put_ref(ptr) def __init__(self): ptr = native_bt.interrupter_create() if ptr is None: - raise bt2._MemoryError('cannot create interrupter object') + raise bt2_error._MemoryError("cannot create interrupter object") super().__init__(ptr)