test_error.py: remove dangling print()
[babeltrace.git] / src / bindings / python / bt2 / bt2 / message.py
index 35cb1bbe6b2886b88cd5d4a0852b3a22636bf02a..5a1ca32dea78900b45c61b71e56941dab810c2ae 100644 (file)
@@ -30,10 +30,6 @@ import bt2
 
 def _create_from_ptr(ptr):
     msg_type = native_bt.message_get_type(ptr)
-
-    if msg_type not in _MESSAGE_TYPE_TO_CLS:
-        raise bt2.Error('unknown message type: {}'.format(msg_type))
-
     return _MESSAGE_TYPE_TO_CLS[msg_type]._create_from_ptr(ptr)
 
 
@@ -44,7 +40,7 @@ class _Message(object._SharedObject):
     @staticmethod
     def _check_has_default_clock_class(clock_class):
         if clock_class is None:
-            raise bt2.NonexistentClockSnapshot(
+            raise ValueError(
                 'cannot get default clock snapshot: stream class has no default clock class'
             )
 
@@ -184,7 +180,7 @@ class _DiscardedMessage(_Message, _MessageWithDefaultClockSnapshot):
 
     def _check_has_default_clock_snapshots(self):
         if not self._has_default_clock_snapshots:
-            raise bt2.NonexistentClockSnapshot(
+            raise ValueError(
                 'cannot get default clock snapshot: such a message has no clock snapshots for this stream class'
             )
 
This page took 0.024318 seconds and 4 git commands to generate.