Skip to content

Commit

Permalink
fix: handle unknown platform
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Sep 23, 2024
1 parent 3f8f4f4 commit 9ce357b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dep_logic/tags/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ def current(cls) -> Self:
if len(platform_info) == 1:
if platform_info[0] == "win32":
return cls(os.Windows(), Arch.X86)
else:
raise PlatformError(f"Unsupported platform {platform_}")
operating_system, _, version_arch = (
platform_.replace(".", "_").replace(" ", "_").partition("_")
)
else:
[operating_system, version_arch] = platform_info
operating_system, version_arch = platform_info
if "-" in version_arch:
# Ex: macosx-11.2-arm64
version, architecture = version_arch.rsplit("-", 1)
Expand Down

0 comments on commit 9ce357b

Please sign in to comment.