mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
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:
parent
c71a81a6bd
commit
a92a7887a6
3 changed files with 10 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue