From b426e9046c28c828646ce486588764620a4ed4b3 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Mon, 10 Jul 2023 10:14:52 +0530 Subject: [PATCH] python: libcgroup.pyx - remove non-Python constructs 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 Signed-off-by: Tom Hromatka --- src/python/libcgroup.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/libcgroup.pyx b/src/python/libcgroup.pyx index 3b3a5eab..4323b73f 100644 --- a/src/python/libcgroup.pyx +++ b/src/python/libcgroup.pyx @@ -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: -- 2.47.2