From df5f69dee10e765c9684e14f127baf41882be33f Mon Sep 17 00:00:00 2001 From: Kyle Finley Date: Wed, 3 Jul 2024 08:55:42 -0400 Subject: [PATCH] fix issue causing `aarch64` to raise `UnknownPlatformArchitectureError` (#101) --- f_lib/_system_info.py | 2 +- tests/unit/test__system_info.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/f_lib/_system_info.py b/f_lib/_system_info.py index ac6e950..01cc5e6 100644 --- a/f_lib/_system_info.py +++ b/f_lib/_system_info.py @@ -65,7 +65,7 @@ def is_64bit(self) -> bool: @cached_property def is_arm(self) -> bool: """Whether the system is arm based.""" - return "arm" in platform.machine().lower() + return platform.machine().lower().startswith(("arm", "aarch")) @cached_property def is_frozen(self) -> bool: diff --git a/tests/unit/test__system_info.py b/tests/unit/test__system_info.py index b2aae16..aaa73b3 100644 --- a/tests/unit/test__system_info.py +++ b/tests/unit/test__system_info.py @@ -89,7 +89,7 @@ def test_is_64bit(self, expected: bool, maxsize: int, mocker: MockerFixture) -> assert SystemInfo().is_64bit is expected @pytest.mark.parametrize( - ("expected", "machine"), [(False, "leg"), (True, "arm"), (True, "ARM")] + ("expected", "machine"), [(False, "leg"), (True, "arm"), (True, "ARM"), (True, "aarch")] ) def test_is_arm(self, expected: bool, machine: str, mocker: MockerFixture) -> None: """Test is_arm."""