From 7f205697ce558ee6b74905734051bbaa00f50efb Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Mon, 3 Feb 2025 00:53:14 +0800 Subject: [PATCH] Update SystemRuntime.py Signed-off-by: Loren Eteval --- Furious/Utility/SystemRuntime.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Furious/Utility/SystemRuntime.py b/Furious/Utility/SystemRuntime.py index 2640d631..d1d1f07e 100644 --- a/Furious/Utility/SystemRuntime.py +++ b/Furious/Utility/SystemRuntime.py @@ -38,6 +38,7 @@ __all__ = [ ] +@functools.lru_cache(None) def getPythonVersion(): return '.'.join(str(info) for info in sys.version_info) @@ -82,10 +83,12 @@ def isVPNMode() -> bool: return isAdministrator() and AppSettings.isStateON_('VPNMode') +@functools.lru_cache(None) def isScriptMode() -> bool: return sys.argv[0].endswith('.py') +@functools.lru_cache(None) def isPythonw() -> bool: def isRealFile(file): if not hasattr(file, 'fileno'): @@ -106,5 +109,6 @@ def isPythonw() -> bool: return not isRealFile(sys.__stdout__) or not isRealFile(sys.__stderr__) +@functools.lru_cache(None) def isWindows7() -> bool: return PLATFORM == 'Windows' and PLATFORM_RELEASE == '7'