Apply black code formatter on all Python code
[babeltrace.git] / src / bindings / python / bt2 / bt2 / clock_class.py
index 59a93cd7884a8bf596352ed15f49d20bb64c0d21..932a26635bf97b29fe0fb1f720074836de3b0264 100644 (file)
@@ -58,8 +58,8 @@ class _ClockClass(object._SharedObject):
 
     def _name(self, name):
         utils._check_str(name)
-        ret = native_bt.clock_class_set_name(self._ptr, name)
-        utils._handle_ret(ret, "cannot set clock class object's name")
+        status = native_bt.clock_class_set_name(self._ptr, name)
+        utils._handle_func_status(status, "cannot set clock class object's name")
 
     _name = property(fset=_name)
 
@@ -69,8 +69,8 @@ class _ClockClass(object._SharedObject):
 
     def _description(self, description):
         utils._check_str(description)
-        ret = native_bt.clock_class_set_description(self._ptr, description)
-        utils._handle_ret(ret, "cannot set clock class object's description")
+        status = native_bt.clock_class_set_description(self._ptr, description)
+        utils._handle_func_status(status, "cannot set clock class object's description")
 
     _description = property(fset=_description)
 
@@ -112,7 +112,9 @@ class _ClockClass(object._SharedObject):
 
     def _origin_is_unix_epoch(self, origin_is_unix_epoch):
         utils._check_bool(origin_is_unix_epoch)
-        native_bt.clock_class_set_origin_is_unix_epoch(self._ptr, int(origin_is_unix_epoch))
+        native_bt.clock_class_set_origin_is_unix_epoch(
+            self._ptr, int(origin_is_unix_epoch)
+        )
 
     _origin_is_unix_epoch = property(fset=_origin_is_unix_epoch)
 
@@ -133,12 +135,7 @@ class _ClockClass(object._SharedObject):
 
     def cycles_to_ns_from_origin(self, cycles):
         utils._check_uint64(cycles)
-        ret, ns = native_bt.clock_class_cycles_to_ns_from_origin(self._ptr, cycles)
-
+        status, ns = native_bt.clock_class_cycles_to_ns_from_origin(self._ptr, cycles)
         error_msg = "cannot convert clock value to nanoseconds from origin for given clock class"
-
-        if ret == native_bt.CLOCK_CLASS_STATUS_OVERFLOW:
-            raise OverflowError(error_msg)
-
-        utils._handle_ret(ret, error_msg)
+        utils._handle_func_status(status, error_msg)
         return ns
This page took 0.023907 seconds and 4 git commands to generate.