From fa5524890e86d353ee7d2194ccdd6c84e9bd2d31 Mon Sep 17 00:00:00 2001 From: Frazer Clews Date: Thu, 16 Jan 2020 17:11:19 +0000 Subject: bitbake: lib: amend code to use proper singleton comparisons where possible amend the code to handle singleton comparisons properly so it only checks if they only refer to the same object or not, and not bother comparing the values. (Bitbake rev: b809a6812aa15a8a9af97bc382cc4b19571e6bfc) Signed-off-by: Frazer Clews Signed-off-by: Richard Purdie --- bitbake/lib/pyinotify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/pyinotify.py') diff --git a/bitbake/lib/pyinotify.py b/bitbake/lib/pyinotify.py index 1528a22e8d..6ae40a2d76 100644 --- a/bitbake/lib/pyinotify.py +++ b/bitbake/lib/pyinotify.py @@ -1274,7 +1274,7 @@ class Notifier: basename = os.path.basename(sys.argv[0]) or 'pyinotify' pid_file = os.path.join(dirname, basename + '.pid') - if pid_file != False and os.path.lexists(pid_file): + if pid_file and os.path.lexists(pid_file): err = 'Cannot daemonize: pid file %s already exists.' % pid_file raise NotifierError(err) @@ -1308,7 +1308,7 @@ class Notifier: fork_daemon() # Write pid - if pid_file != False: + if pid_file: flags = os.O_WRONLY|os.O_CREAT|os.O_NOFOLLOW|os.O_EXCL fd_pid = os.open(pid_file, flags, 0o0600) os.write(fd_pid, bytes(str(os.getpid()) + '\n', -- cgit v1.2.3-54-g00ecf