Python bindings: accomodate API changes introduced for negative time
[babeltrace.git] / bindings / python / writer.py
index 3d4797eba28a9f399cdb20058a1f0664dc0998bf..b419a271161f198c4fe6c2d48a9ea1f3e1091892 100644 (file)
@@ -168,9 +168,9 @@ class Clock:
         :exc:`ValueError` is raised on error.
         """
 
-        offset_s = nbt._bt_ctf_clock_get_offset_s(self._c)
+        ret, offset_s = nbt._bt_ctf_clock_get_offset_s(self._c)
 
-        if offset_s == _MAX_UINT64:
+        if ret < 0:
             raise ValueError("Invalid clock instance")
 
         return offset_s
@@ -193,9 +193,9 @@ class Clock:
         :exc:`ValueError` is raised on error.
         """
 
-        offset = nbt._bt_ctf_clock_get_offset(self._c)
+        ret, offset = nbt._bt_ctf_clock_get_offset(self._c)
 
-        if offset == _MAX_UINT64:
+        if ret < 0:
             raise ValueError("Invalid clock instance")
 
         return offset
@@ -280,9 +280,9 @@ class Clock:
         :exc:`ValueError` is raised on error.
         """
 
-        time = nbt._bt_ctf_clock_get_time(self._c)
+        ret, time = nbt._bt_ctf_clock_get_time(self._c)
 
-        if time == _MAX_UINT64:
+        if ret < 0:
             raise ValueError("Invalid clock instance")
 
         return time
This page took 0.024351 seconds and 4 git commands to generate.