X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fstream.py;h=eb780b0ee6ab02c9d0c78ff6502f0037a9593597;hp=5accfcd0751cfdf271121587b1b6b0d8c73a1ab1;hb=26fc5aedf;hpb=bfb5625df591dcd384f50af3a93c5904ea6b7fcd diff --git a/src/bindings/python/bt2/bt2/stream.py b/src/bindings/python/bt2/bt2/stream.py index 5accfcd0..eb780b0e 100644 --- a/src/bindings/python/bt2/bt2/stream.py +++ b/src/bindings/python/bt2/bt2/stream.py @@ -52,6 +52,9 @@ class _Stream(bt2.object._SharedObject): return id if id >= 0 else None def create_packet(self): + if not self.cls.supports_packets: + raise bt2.Error('cannot create packet: stream class does not support packets') + packet_ptr = native_bt.packet_create(self._ptr) if packet_ptr is None: