Comparision to None should be done with "is" or "is not"

https://www.python.org/dev/peps/pep-0008/#programming-recommendations
This commit is contained in:
Michal 2018-09-17 14:35:30 +02:00 committed by Jehan
parent 46e5e4d478
commit 09d1a3c82f
2 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ def main ():
scriptdir_loc = os.path.dirname (os.path.realpath (__file__))
targets_loc = os.path.join (scriptdir_loc, "targets")
if packages_loc == None:
if packages_loc is None:
packages_loc = os.path.join (targets_loc, "packages")
run (targets_loc, packages_loc)

View File

@ -52,7 +52,7 @@ class pixel_fetcher:
row = y / self.tile_height
rowoff = y % self.tile_height
if col != self.col or row != self.row or self.tile == None:
if col != self.col or row != self.row or self.tile is None:
self.tile = self.drawable.get_tile(False, row, col)
self.col = col
self.row = row