From 042bd46fba85bcdb77d3f325b1ccdc7f654070c8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 8 Oct 2021 15:59:42 +0200 Subject: [PATCH] Don't import CuraApplication if not type checking Otherwise we'll get unnecessary import loops here. Contributes to issue CURA-8609. --- cura/UltimakerCloud/UltimakerCloudScope.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cura/UltimakerCloud/UltimakerCloudScope.py b/cura/UltimakerCloud/UltimakerCloudScope.py index 5477423099..c8ac35f893 100644 --- a/cura/UltimakerCloud/UltimakerCloudScope.py +++ b/cura/UltimakerCloud/UltimakerCloudScope.py @@ -1,9 +1,15 @@ +# Copyright (c) 2021 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. + from PyQt5.QtNetwork import QNetworkRequest from UM.Logger import Logger from UM.TaskManagement.HttpRequestScope import DefaultUserAgentScope from cura.API import Account -from cura.CuraApplication import CuraApplication + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from cura.CuraApplication import CuraApplication class UltimakerCloudScope(DefaultUserAgentScope): @@ -12,7 +18,7 @@ class UltimakerCloudScope(DefaultUserAgentScope): Also add the user agent headers (see DefaultUserAgentScope). """ - def __init__(self, application: CuraApplication): + def __init__(self, application: "CuraApplication"): super().__init__(application) api = application.getCuraAPI() self._account = api.account # type: Account