Skip to content

Commit 74e13ee

Browse files
committed
improves machine architecture check
Slightly refactors the code in core to enhance readability and simplify the logic for checking supported machine architectures
1 parent 2a3c1eb commit 74e13ee

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/onepassword/core.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
import platform
33

44

5-
if platform.machine().lower() == "x86_64" or platform.machine().lower() == "amd64":
5+
machine_arch = platform.machine().lower()
6+
7+
if machine_arch in ["x86_64", "amd64"]:
68
import onepassword.lib.x86_64.op_uniffi_core as core
7-
elif platform.machine().lower() == "aarch64" or platform.machine().lower() == "arm64":
9+
elif machine_arch in ["aarch64", "arm64"]:
810
import onepassword.lib.aarch64.op_uniffi_core as core
911
else:
10-
raise ImportError(
11-
"your machine's architecture is not currently supported: {}".format(
12-
platform.machine()
13-
)
14-
)
12+
raise ImportError(f"Your machine's architecture is not currently supported: {machine_arch}")
1513

1614

1715
# InitClient creates a client instance in the current core module and returns its unique ID.

0 commit comments

Comments
 (0)