From 2f4a5a483090516875cb9abea97ad6a2164f768b Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Fri, 31 Jan 2020 18:16:36 +0300 Subject: [PATCH] Fix improper use of operator "is" when comparing to literal values --- gui/characterEditor.py | 2 +- gui/characterSelection.py | 2 +- gui/mainFrame.py | 2 +- service/port/xml.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 24ff84700..bc4718324 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -839,7 +839,7 @@ class APIView(wx.Panel): def getActiveCharacter(self): selection = self.charChoice.GetCurrentSelection() - return self.charChoice.GetClientData(selection) if selection is not -1 else None + return self.charChoice.GetClientData(selection) if selection != -1 else None def ssoListChanged(self, event): if not self: # todo: fix event not unbinding properly diff --git a/gui/characterSelection.py b/gui/characterSelection.py index 27b781b7d..0ad63c948 100644 --- a/gui/characterSelection.py +++ b/gui/characterSelection.py @@ -122,7 +122,7 @@ class CharacterSelection(wx.Panel): def getActiveCharacter(self): selection = self.charChoice.GetCurrentSelection() - return self.charChoice.GetClientData(selection) if selection is not -1 else None + return self.charChoice.GetClientData(selection) if selection != -1 else None def refreshCharacterList(self, event=None): choice = self.charChoice diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 05744a504..ac209bd91 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -254,7 +254,7 @@ class MainFrame(wx.Frame): except: fits.remove(id) - if not self.prevOpenFits['enabled'] or len(fits) is 0: + if not self.prevOpenFits['enabled'] or len(fits) == 0: # add blank page if there are no fits to be loaded self.fitMultiSwitch.AddPage() return diff --git a/service/port/xml.py b/service/port/xml.py index 5f105a718..1377e15d5 100644 --- a/service/port/xml.py +++ b/service/port/xml.py @@ -88,7 +88,7 @@ def _resolve_ship(fitting, sMkt, b_localized): pyfalog.warning("Caught exception on _resolve_ship") pyfalog.error(e) limit -= 1 - if limit is 0: + if limit == 0: break shipType = anything must_retry = True @@ -132,7 +132,7 @@ def _resolve_module(hardware, sMkt, b_localized): pyfalog.warning("Caught exception on _resolve_module") pyfalog.error(e) limit -= 1 - if limit is 0: + if limit == 0: break moduleName = emergency must_retry = True