Skip to content

Commit 9ce357b

Browse files
committedSep 23, 2024··
fix: handle unknown platform
Signed-off-by: Frost Ming <[email protected]>
1 parent 3f8f4f4 commit 9ce357b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/dep_logic/tags/platform.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ def current(cls) -> Self:
109109
if len(platform_info) == 1:
110110
if platform_info[0] == "win32":
111111
return cls(os.Windows(), Arch.X86)
112-
else:
113-
raise PlatformError(f"Unsupported platform {platform_}")
112+
operating_system, _, version_arch = (
113+
platform_.replace(".", "_").replace(" ", "_").partition("_")
114+
)
114115
else:
115-
[operating_system, version_arch] = platform_info
116+
operating_system, version_arch = platform_info
116117
if "-" in version_arch:
117118
# Ex: macosx-11.2-arm64
118119
version, architecture = version_arch.rsplit("-", 1)

0 commit comments

Comments
 (0)
Please sign in to comment.