diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py index fbb857ef78..420c1c0afc 100644 --- a/cura/Settings/ContainerManager.py +++ b/cura/Settings/ContainerManager.py @@ -47,11 +47,11 @@ class ContainerManager(QObject): def __init__(self, application: "CuraApplication") -> None: if ContainerManager.__instance is not None: raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__) - ContainerManager.__instance = self try: super().__init__(parent = application) except TypeError: super().__init__() + ContainerManager.__instance = self self._container_name_filters = {} # type: Dict[str, Dict[str, Any]] diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index dfe0ccbcfd..34ba96e280 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -31,9 +31,9 @@ class ExtruderManager(QObject): if ExtruderManager.__instance is not None: raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__) - ExtruderManager.__instance = self super().__init__(parent) + ExtruderManager.__instance = self self._application = cura.CuraApplication.CuraApplication.getInstance() diff --git a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py index b7b4b5c29b..5d68d9f544 100644 --- a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py +++ b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py @@ -30,9 +30,10 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin): def __init__(self, application, parent = None): if USBPrinterOutputDeviceManager.__instance is not None: raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__) - USBPrinterOutputDeviceManager.__instance = self super().__init__(parent = parent) + USBPrinterOutputDeviceManager.__instance = self + self._application = application self._serial_port_list = [] diff --git a/plugins/XmlMaterialProfile/PluginInfo.py b/plugins/XmlMaterialProfile/PluginInfo.py index 4b78a47a5e..b88bea21eb 100644 --- a/plugins/XmlMaterialProfile/PluginInfo.py +++ b/plugins/XmlMaterialProfile/PluginInfo.py @@ -5,9 +5,9 @@ class PluginInfo(PluginObject): __instance = None # type: PluginInfo def __init__(self, *args, **kwags): - super().__init__(*args, **kwags) if PluginInfo.__instance is not None: raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__) + super().__init__(*args, **kwags) PluginInfo.__instance = self @classmethod