From c2566800f6cc97bc4e36ff377f59a088c75248e2 Mon Sep 17 00:00:00 2001 From: Matthew Bradbury Date: Wed, 31 Jul 2024 15:38:23 +0100 Subject: [PATCH] Detect lib directory correctly on 32-bit OSes and aarch64 --- pynrfjprog/Parameters.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pynrfjprog/Parameters.py b/pynrfjprog/Parameters.py index 1537ce8..4b35eac 100644 --- a/pynrfjprog/Parameters.py +++ b/pynrfjprog/Parameters.py @@ -32,9 +32,13 @@ def find_lib_dir(): os_name = sys.platform.lower() if platform.machine().startswith('arm') and not os_name.startswith('dar'): + assert sys.maxsize <= 2**32 nrfjprog_dll_folder = 'lib_armhf' elif platform.machine().startswith('aarch') and not os_name.startswith('dar'): - nrfjprog_dll_folder = 'lib_arm64' + if sys.maxsize > 2**32: + nrfjprog_dll_folder = 'lib_arm64' + else: + nrfjprog_dll_folder = 'lib_armhf' else: if sys.maxsize > 2**32: nrfjprog_dll_folder = 'lib_x64'