File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import platform
4+ from functools import lru_cache
45from pathlib import Path
56from typing import TYPE_CHECKING
67
1920 else :
2021 from typing_extensions import Self
2122
22- SYS_ARCHITECTURE = platform .architecture ()[0 ]
23+
24+ @lru_cache
25+ def sys_architecture () -> str :
26+ """Return the system architecture."""
27+ return platform .architecture ()[0 ]
2328
2429
2530class WinregProvider (BaseProvider ):
@@ -35,6 +40,7 @@ def find_pythons(self) -> Iterable[PythonVersion]:
3540 from findpython .pep514tools import findall as pep514_findall
3641
3742 env_versions = pep514_findall ()
43+ sys_arch = sys_architecture ()
3844 for version in env_versions :
3945 install_path = getattr (version .info , "install_path" , None )
4046 if install_path is None :
@@ -54,7 +60,7 @@ def find_pythons(self) -> Iterable[PythonVersion]:
5460 py_ver = self .version_maker (
5561 path ,
5662 parse_version ,
57- getattr (version .info , "sys_architecture" , SYS_ARCHITECTURE ),
63+ getattr (version .info , "sys_architecture" , sys_arch ),
5864 path ,
5965 )
6066 yield py_ver
You can’t perform that action at this time.
0 commit comments