Fixes issue # 1554:

Replaced "== None" and "!= None" with "is None" and "is not None", respectively, because the former is slower and error-prone.
This commit is contained in:
Per A. Brodtkorb
2020-03-23 11:53:36 +01:00
parent ef1edacc20
commit fc1823315b
50 changed files with 174 additions and 174 deletions

View File

@@ -117,7 +117,7 @@ class SimpleGrid(wx.grid.Grid):
def OnIdle(self, evt):
if self.moveTo != None:
if self.moveTo is not None:
self.SetGridCursor(self.moveTo[0], self.moveTo[1])
self.moveTo = None

View File

@@ -324,7 +324,7 @@ class RibbonFrame(wx.Frame):
def GetGalleryColour(self, gallery, item, name=None):
data = gallery.GetItemClientData(item)
if name != None:
if name is not None:
name = data.GetName()
return data.GetColour(), name
@@ -337,7 +337,7 @@ class RibbonFrame(wx.Frame):
gallery = event.GetGallery()
provider = gallery.GetArtProvider()
if event.GetGalleryItem() != None:
if event.GetGalleryItem() is not None:
if provider == self._ribbon.GetArtProvider():
gallery.SetArtProvider(provider)
@@ -607,7 +607,7 @@ class RibbonFrame(wx.Frame):
item = None
# Colour not in gallery - add it
if item == None:
if item is None:
item = self.AddColourToGallery(gallery,
clr.GetAsString(wx.C2S_HTML_SYNTAX),
self._bitmap_creation_dc,