lib: strictly type function return status enumerations
[babeltrace.git] / src / bindings / python / bt2 / bt2 / clock_snapshot.py
index 89d7a11b5847413fac7209625a767b9cfa6dff5b..46abdc7856b4c362a39d850e7cdbdfbacaa1449f 100644 (file)
@@ -40,11 +40,9 @@ class _ClockSnapshot(object._UniqueObject):
 
     @property
     def ns_from_origin(self):
-        ret, ns = native_bt.clock_snapshot_get_ns_from_origin(self._ptr)
-
-        if ret == native_bt.CLOCK_SNAPSHOT_STATUS_OVERFLOW:
-            raise OverflowError("cannot get clock snapshot's nanoseconds from origin")
-
+        status, ns = native_bt.clock_snapshot_get_ns_from_origin(self._ptr)
+        utils._handle_func_status(status,
+                                  "cannot get clock snapshot's nanoseconds from origin")
         return ns
 
     def __eq__(self, other):
This page took 0.023153 seconds and 4 git commands to generate.