mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Fix mypy issue
CURA-8332
This commit is contained in:
parent
9fd0ac333e
commit
4a8b5ae61e
1 changed files with 10 additions and 3 deletions
|
@ -14,17 +14,24 @@ if TYPE_CHECKING:
|
||||||
# Need to do some extra workarounds on windows:
|
# Need to do some extra workarounds on windows:
|
||||||
import sys
|
import sys
|
||||||
from UM.Platform import Platform
|
from UM.Platform import Platform
|
||||||
|
|
||||||
|
|
||||||
|
class _KeychainDenied(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
if Platform.isWindows() and hasattr(sys, "frozen"):
|
if Platform.isWindows() and hasattr(sys, "frozen"):
|
||||||
import win32timezone
|
import win32timezone
|
||||||
from keyring.backends.Windows import WinVaultKeyring
|
from keyring.backends.Windows import WinVaultKeyring
|
||||||
keyring.set_keyring(WinVaultKeyring())
|
keyring.set_keyring(WinVaultKeyring())
|
||||||
if Platform.isOSX() and hasattr(sys, "frozen"):
|
if Platform.isOSX() and hasattr(sys, "frozen"):
|
||||||
from keyring.backends.macOS import Keyring
|
from keyring.backends.macOS import Keyring
|
||||||
from keyring.backends.macOS.api import KeychainDenied
|
from keyring.backends.macOS.api import KeychainDenied as _KeychainDeniedMacOS
|
||||||
|
KeychainDenied = _KeychainDeniedMacOS
|
||||||
keyring.set_keyring(Keyring())
|
keyring.set_keyring(Keyring())
|
||||||
else:
|
else:
|
||||||
class KeychainDenied(Exception):
|
KeychainDenied = _KeychainDenied
|
||||||
pass
|
|
||||||
|
|
||||||
# Even if errors happen, we don't want this stored locally:
|
# Even if errors happen, we don't want this stored locally:
|
||||||
DONT_EVER_STORE_LOCALLY: List[str] = ["refresh_token"]
|
DONT_EVER_STORE_LOCALLY: List[str] = ["refresh_token"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue