From a31a7f2b061ee11ccb591ec8a55e5c7e13039115 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 13 Jul 2022 18:26:21 +0300 Subject: [PATCH] Improved detection of Windows architecture // Resolve #4353 --- HISTORY.rst | 1 + platformio/util.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 51bd288e..72d5fa89 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,7 @@ PlatformIO Core 6 6.1.2 (2022-07-??) ~~~~~~~~~~~~~~~~~~ +* Improved detection of Windows architecture (`issue #4353 `_) * Fixed a regression bug when `libArchive `__ option declared in the `library.json `__ manifest was ignored (`issue #4351 `_) * Fixed an issue when the `pio pkg publish `__ command didn't work with Python 3.6 (`issue #4352 `_) diff --git a/platformio/util.py b/platformio/util.py index f235c2ee..f6800b4f 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -139,11 +139,14 @@ def singleton(cls): def get_systype(): - type_ = platform.system().lower() + system = platform.system().lower() arch = platform.machine().lower() - if type_ == "windows" and "x86" in arch: - arch = "amd64" if "64" in arch else "x86" - return "%s_%s" % (type_, arch) if arch else type_ + if system == "windows": + if not arch: # issue #4353 + arch = "x86_" + platform.architecture()[0] + if "x86" in arch: + arch = "amd64" if "64" in arch else "x86" + return "%s_%s" % (system, arch) if arch else system def pioversion_to_intstr():