From f1f8847a8611c21d809edde6eef07f287aa35a2a Mon Sep 17 00:00:00 2001 From: prculley Date: Mon, 30 Mar 2020 15:48:06 -0500 Subject: [PATCH] Fix some Python syntax errors that appear in v3.8.x Fixes #11641 --- gramps/gen/plug/_manager.py | 2 +- gramps/gen/plug/_pluginreg.py | 2 +- gramps/gui/pluginmanager.py | 2 +- gramps/plugins/lib/maps/messagelayer.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gramps/gen/plug/_manager.py b/gramps/gen/plug/_manager.py index 8fc4348f7..51bd85a2c 100644 --- a/gramps/gen/plug/_manager.py +++ b/gramps/gen/plug/_manager.py @@ -83,7 +83,7 @@ class BasePluginManager: def __init__(self): """ This function should only be run once by get_instance() """ - if BasePluginManager.__instance is not 1: + if BasePluginManager.__instance != 1: raise Exception("This class is a singleton. " "Use the get_instance() method") diff --git a/gramps/gen/plug/_pluginreg.py b/gramps/gen/plug/_pluginreg.py index b2e710fec..10c08db4d 100644 --- a/gramps/gen/plug/_pluginreg.py +++ b/gramps/gen/plug/_pluginreg.py @@ -1135,7 +1135,7 @@ class PluginRegister: def __init__(self): """ This function should only be run once by get_instance() """ - if PluginRegister.__instance is not 1: + if PluginRegister.__instance != 1: raise Exception("This class is a singleton. " "Use the get_instance() method") self.stable_only = True diff --git a/gramps/gui/pluginmanager.py b/gramps/gui/pluginmanager.py index df5748001..f2525304d 100644 --- a/gramps/gui/pluginmanager.py +++ b/gramps/gui/pluginmanager.py @@ -71,7 +71,7 @@ class GuiPluginManager(Callback): def __init__(self): """ This function should only be run once by get_instance() """ - if GuiPluginManager.__instance is not 1: + if GuiPluginManager.__instance != 1: raise Exception("This class is a singleton. " "Use the get_instance() method") diff --git a/gramps/plugins/lib/maps/messagelayer.py b/gramps/plugins/lib/maps/messagelayer.py index 6093d84f9..1ce6d1193 100644 --- a/gramps/plugins/lib/maps/messagelayer.py +++ b/gramps/plugins/lib/maps/messagelayer.py @@ -113,7 +113,7 @@ class MessageLayer(GObject.GObject, osmgpsmap.MapLayer): """ Add a message """ - self.message += "\n%s" % message if self.message is not "" else message + self.message += "\n%s" % message if self.message else message def do_draw(self, gpsmap, ctx): """