python: replace equality with identity test

PEP8 recommends for comparisons to singletons like None to always be
done with 'is' or 'is not', never the equality operators.

https://python.org/dev/peps/pep-0008/#programming-recommendations

Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
This commit is contained in:
Radostin Stoyanov 2021-09-05 21:36:10 +01:00 committed by Andrei Vagin
parent c71a81a6bd
commit a92a7887a6
3 changed files with 10 additions and 10 deletions

View file

@ -725,10 +725,10 @@ class coredump_generator:
# and choose appropriate.
page_mem = self._get_page(pid, page_no)
if f != None:
if f is not None:
page = f.read(PAGESIZE)
if page_mem != None:
if page_mem is not None:
# Page from pages.img has higher priority
# than one from maped file on disk.
page = page_mem
@ -755,7 +755,7 @@ class coredump_generator:
buf += page[n_skip:n_skip + n_read]
# Don't forget to close file.
if f != None:
if f is not None:
f.close()
return buf