Skip to content

Commit

Permalink
fix: architecture for win32 and macos
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jul 19, 2024
1 parent 663bbb4 commit 3d42a38
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dep_logic/tags/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def current(cls) -> Self:

system = platform.system()
arch = Arch.parse(platform.machine().lower())
if (
platform.machine().lower() == "amd64"
and platform.architecture()[0] == "32bit"
):
arch = Arch.parse("x86")
if system == "Linux":
libc_ver = platform.libc_ver()[1]
if libc_ver:
Expand All @@ -108,7 +113,10 @@ def current(cls) -> Self:
return cls(os.Windows(), arch)
elif system == "Darwin":
mac_ver = platform.mac_ver()[0].split(".")
return cls(os.Macos(int(mac_ver[0]), int(mac_ver[1])), arch)
major, minor = int(mac_ver[0]), int(mac_ver[1])
if major >= 11:
minor = 0
return cls(os.Macos(major, minor), arch)
else:
raise PlatformError("Unsupported platform")

Expand Down

0 comments on commit 3d42a38

Please sign in to comment.