1
0
Fork 0

Fix checking for None values

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>
This commit is contained in:
Ondřej Lysoněk 2019-03-05 10:31:42 +01:00
parent e5fbac1863
commit 9e6913231d
3 changed files with 3 additions and 3 deletions

View file

@ -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:

View file

@ -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

View file

@ -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