]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
python: libcgroup.pyx - remove non-Python constructs
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Mon, 10 Jul 2023 04:44:52 +0000 (10:14 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 12 Jul 2023 18:57:31 +0000 (12:57 -0600)
Fix few cython-lints non-Python constructs, reported by cython-lint
tool:
- libcgroup.pyx:222:26: E711 comparison to None should be 'if cond is None:'
- libcgroup.pyx:380:82: E703 statement ends with a semicolon

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/python/libcgroup.pyx

index 3b3a5eab64cd4dcaaa27d80cf8276f1b3530a1c5..4323b73ff459dd904a528afcce9c9ae3e2e64adb 100644 (file)
@@ -219,7 +219,7 @@ cdef class Cgroup:
                 raise RuntimeError("Failed to get controller {}".format(
                                    ctrl_name))
 
-        if setting_value == None:
+        if setting_value is None:
             ret = cgroup.cgroup_add_value_string(cgcp,
                       c_str(setting_name), NULL)
         else:
@@ -377,7 +377,7 @@ cdef class Cgroup:
         mount_points = []
         ret = cgroup.cgroup_list_mount_points(version, &a)
         if ret is not 0:
-            raise RuntimeError("cgroup_list_mount_points failed: {}".format(ret));
+            raise RuntimeError("cgroup_list_mount_points failed: {}".format(ret))
 
         i = 0
         while a[i]:
@@ -812,6 +812,6 @@ cdef class Cgroup:
         cgroup.cgroup_set_default_logger(log_level)
 
     def __dealloc__(self):
-        cgroup.cgroup_free(&self._cgp);
+        cgroup.cgroup_free(&self._cgp)
 
 # vim: set et ts=4 sw=4: