Move to kernel style SPDX license identifiers
[babeltrace.git] / src / bindings / python / bt2 / bt2 / object.py
index 218965de7799762839cae6120696a55ff21023b7..22000e21e1c80670227f2b16145fd1b624a9f1a0 100644 (file)
@@ -1,24 +1,6 @@
-# The MIT License (MIT)
+# SPDX-License-Identifier: MIT
 #
 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
 
 
 class _BaseObject:
@@ -38,9 +20,9 @@ class _BaseObject:
         return int(self._ptr)
 
     def __repr__(self):
-        return '<{}.{} object @ {}>'.format(self.__class__.__module__,
-                                            self.__class__.__name__,
-                                            hex(self.addr))
+        return '<{}.{} object @ {}>'.format(
+            self.__class__.__module__, self.__class__.__name__, hex(self.addr)
+        )
 
     def __copy__(self):
         raise NotImplementedError
@@ -58,6 +40,7 @@ class _BaseObject:
 # of unique objects, we make it so acquiring a reference on a unique object
 # acquires a reference on its owner.
 
+
 class _UniqueObject(_BaseObject):
 
     # Create a _UniqueObject.
@@ -69,8 +52,7 @@ class _UniqueObject(_BaseObject):
     #   - owner_put_ref: Callback to put a reference on the owner.
 
     @classmethod
-    def _create_from_ptr_and_get_ref(cls, ptr, owner_ptr,
-                                     owner_get_ref, owner_put_ref):
+    def _create_from_ptr_and_get_ref(cls, ptr, owner_ptr, owner_get_ref, owner_put_ref):
         obj = cls.__new__(cls)
 
         obj._ptr = ptr
@@ -127,12 +109,5 @@ class _SharedObject(_BaseObject):
         cls._get_ref(obj._ptr)
         return obj
 
-    def _release(self):
-        """Return the wrapped pointer, transfer its ownership to the
-        caller."""
-        ptr = self._ptr
-        self._ptr = None
-        return ptr
-
     def __del__(self):
         self._put_ref(self._ptr)
This page took 0.024871 seconds and 4 git commands to generate.