From 012d299d980e87136feb8da4062de6940b378c9d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 10 Jul 2017 16:42:38 +0200 Subject: [PATCH] Prevent circular import When this is imported during the __init__, it'll long have been imported elsewhere and won't need to import it again but still guarantees that it is actually imported if no other module does it first. Contributes to issue CURA-4024. --- cura/Settings/CuraContainerStack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/CuraContainerStack.py b/cura/Settings/CuraContainerStack.py index 75f3034362..cdda14ee18 100755 --- a/cura/Settings/CuraContainerStack.py +++ b/cura/Settings/CuraContainerStack.py @@ -8,7 +8,6 @@ from typing import Any, Optional from PyQt5.QtCore import pyqtProperty, pyqtSignal, QObject from UM.FlameProfiler import pyqtSlot -import cura.CuraApplication #To get the setting version. from UM.Decorators import override from UM.Logger import Logger from UM.Settings.ContainerStack import ContainerStack, InvalidContainerStackError @@ -48,6 +47,7 @@ class CuraContainerStack(ContainerStack): self.containersChanged.connect(self._onContainersChanged) + import cura.CuraApplication #Here to prevent circular imports. self.addMetaDataEntry("setting_version", cura.CuraApplication.CuraApplication.SettingVersion) # This is emitted whenever the containersChanged signal from the ContainerStack base class is emitted.