Skip to content

Commit 13bb015

Browse files
committed
fix core.py version comparsion and lower of arch
1 parent dc0526b commit 13bb015

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/onepassword/core.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
# We set the limit to 50MB to be safe and consistent with the other SDKs (where this limit is 64MB), to be reconsidered upon further testing
99
MESSAGE_LIMIT = 50 * 1024 * 1024
1010

11-
machine_arch = platform.machine()
12-
python_version = platform.python_version()[:4]
11+
machine_arch = platform.machine().lower()
12+
major,minor = map(int,platform.python_version()[:4].split('.'))
1313
base_path = "onepassword.lib"
14-
1514
arch_map = {
1615
"x86_64": "x86_64",
1716
"amd64": "x86_64",
@@ -22,9 +21,9 @@
2221
if machine_arch not in arch_map:
2322
raise ImportError(f"Your machine's architecture is not currently supported: {machine_arch}")
2423

25-
if platform.system().lower() == "Darwin":
24+
if platform.system().lower() == "darwin":
2625
if arch_map[machine_arch] == "x86_64":
27-
core_path = f"{base_path}.x86_64_macosx_10_13.op_uniffi_core" if python_version > "3.13" else f"{base_path}.x86_64_macosx_10_9.op_uniffi_core"
26+
core_path = f"{base_path}.x86_64_macosx_10_13.op_uniffi_core" if major > 3 and minor >= 13 else f"{base_path}.x86_64_macosx_10_9.op_uniffi_core"
2827
else:
2928
core_path = f"{base_path}.aarch64_macosx_11_0.op_uniffi_core"
3029
else:

0 commit comments

Comments
 (0)