代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/tuned 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 9e6913231d307590fd6a9bc024be549aaa2d8c5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Tue, 5 Mar 2019 10:31:42 +0100
Subject: [PATCH 099/124] Fix checking for None values
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In python, 'is None' should be used instead of '== None' to check if
something is None.
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
experiments/kwin-stop/xlib-example.py | 2 +-
tuned/plugins/plugin_systemd.py | 2 +-
tuned/profiles/merger.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/experiments/kwin-stop/xlib-example.py b/experiments/kwin-stop/xlib-example.py
index b8477a5..a0d6206 100644
--- a/experiments/kwin-stop/xlib-example.py
+++ b/experiments/kwin-stop/xlib-example.py
@@ -32,7 +32,7 @@ def loop():
root = dpy.screen(num).root
for win in root.get_full_property(dpy.get_atom('_NET_CLIENT_LIST'), 0).value.tolist():
window = dpy.create_resource_object('window', win)
- if window.get_full_property(dpy.get_atom('_NET_WM_STATE'), Xatom.WINDOW) == None:
+ if window.get_full_property(dpy.get_atom('_NET_WM_STATE'), Xatom.WINDOW) is None:
continue
if dpy.get_atom("_NET_WM_STATE_HIDDEN") in window.get_full_property(dpy.get_atom('_NET_WM_STATE'), 0).value.tolist():
if not win in hidden:
diff --git a/tuned/plugins/plugin_systemd.py b/tuned/plugins/plugin_systemd.py
index f6857c5..8f6bbc8 100644
--- a/tuned/plugins/plugin_systemd.py
+++ b/tuned/plugins/plugin_systemd.py
@@ -61,7 +61,7 @@ class SystemdPlugin(base.Plugin):
def _read_systemd_system_conf(self):
systemd_system_conf = self._cmd.read_file(consts.SYSTEMD_SYSTEM_CONF_FILE, err_ret = None)
- if systemd_system_conf == None:
+ if systemd_system_conf is None:
log.error("error reading systemd configuration file")
return None
return systemd_system_conf
diff --git a/tuned/profiles/merger.py b/tuned/profiles/merger.py
index 7a3e05c..2364543 100644
--- a/tuned/profiles/merger.py
+++ b/tuned/profiles/merger.py
@@ -33,7 +33,7 @@ class Merger(object):
profile_a.units[unit_name].type = unit.type
profile_a.units[unit_name].enabled = unit.enabled
profile_a.units[unit_name].devices = unit.devices
- if unit.devices_udev_regex != None:
+ if unit.devices_udev_regex is not None:
profile_a.units[unit_name].devices_udev_regex = unit.devices_udev_regex
if unit.script_pre is not None:
profile_a.units[unit_name].script_pre = unit.script_pre
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。