X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fobject.py;h=c1a23fdf353c8657503221834884f0ec675075e0;hp=fed138eced74e526699c074f53903df915d049a4;hb=e57959f4c84bbec191771a1598e270bfc19b6c7f;hpb=cc610c520f308dd780e0e638975ad0a002a83ef8 diff --git a/src/bindings/python/bt2/bt2/object.py b/src/bindings/python/bt2/bt2/object.py index fed138ec..c1a23fdf 100644 --- a/src/bindings/python/bt2/bt2/object.py +++ b/src/bindings/python/bt2/bt2/object.py @@ -3,6 +3,9 @@ # Copyright (c) 2017 Philippe Proulx +import abc + + class _BaseObject: # Ensure that the object always has _ptr set, even if it throws during # construction. @@ -69,14 +72,14 @@ class _UniqueObject(_BaseObject): # Python object that owns a reference to a Babeltrace object. -class _SharedObject(_BaseObject): - +class _SharedObject(_BaseObject, abc.ABC): # Get a new reference on ptr. # # This must be implemented by subclasses to work correctly with a pointer # of the native type they wrap. @staticmethod + @abc.abstractmethod def _get_ref(ptr): raise NotImplementedError @@ -86,6 +89,7 @@ class _SharedObject(_BaseObject): # of the native type they wrap. @staticmethod + @abc.abstractmethod def _put_ref(ptr): raise NotImplementedError