[utils] Improve performance using functools.cache

Closes #3786
This commit is contained in:
pukkandan 2022-05-19 19:36:31 +05:30
parent 2f97cc615b
commit 0b9c08b47b
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
3 changed files with 19 additions and 3 deletions

View file

@ -7,11 +7,12 @@ import sys
import traceback
from zipimport import zipimporter
from .compat import compat_realpath
from .compat import compat_realpath, functools
from .utils import Popen, encode_compat_str, write_string
from .version import __version__
@functools.cache
def detect_variant():
if hasattr(sys, 'frozen'):
prefix = 'mac' if sys.platform == 'darwin' else 'win'