Browse Source

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.
Ghostkeeper 7 years ago
parent
commit
012d299d98
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cura/Settings/CuraContainerStack.py

+ 1 - 1
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.