class _StreamConst(bt2_object._SharedObject):
- _get_ref = staticmethod(native_bt.stream_get_ref)
- _put_ref = staticmethod(native_bt.stream_put_ref)
+ @staticmethod
+ def _get_ref(ptr):
+ native_bt.stream_get_ref(ptr)
+
+ @staticmethod
+ def _put_ref(ptr):
+ native_bt.stream_put_ref(ptr)
+
_borrow_class_ptr = staticmethod(native_bt.stream_borrow_class_const)
_borrow_user_attributes_ptr = staticmethod(
native_bt.stream_borrow_user_attributes_const
def create_packet(self):
if not self.cls.supports_packets:
raise ValueError(
- 'cannot create packet: stream class does not support packets'
+ "cannot create packet: stream class does not support packets"
)
packet_ptr = native_bt.packet_create(self._ptr)
if packet_ptr is None:
- raise bt2._MemoryError('cannot create packet object')
+ raise bt2._MemoryError("cannot create packet object")
return bt2_packet._Packet._create_from_ptr(packet_ptr)