mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-07 11:10:34 +00:00
fixed uv can't create .venv for cpython-x86 on Windows (#2707)
Adaptation to the win32 platform is added. https://docs.python.org/3/library/sysconfig.html#sysconfig.get_platform ## Summary fixed uv can't create .venv for cpython-x86 on Windows [uv can't create .venv for cpython-x86 on Windows ](https://github.com/astral-sh/rye/issues/952) --------- Co-authored-by: Nashan <34827878+zhuang1234@users.noreply.github.com>
This commit is contained in:
parent
684f790d5d
commit
4b2e67955f
2 changed files with 37 additions and 1 deletions
|
@ -415,7 +415,17 @@ def get_operating_system_and_architecture():
|
|||
"""
|
||||
# https://github.com/pypa/packaging/blob/cc938f984bbbe43c5734b9656c9837ab3a28191f/src/packaging/_musllinux.py#L84
|
||||
# Note that this is not `os.name`.
|
||||
[operating_system, version_arch] = sysconfig.get_platform().split("-", 1)
|
||||
# https://docs.python.org/3/library/sysconfig.html#sysconfig.get_platform
|
||||
# windows x86 will return win32
|
||||
platform_info = sysconfig.get_platform().split("-", 1)
|
||||
if len(platform_info) == 1:
|
||||
if platform_info[0] == "win32":
|
||||
operating_system, version_arch = "win", "i386"
|
||||
else:
|
||||
# unknown_operating_system will flow to the final error print
|
||||
operating_system, version_arch = platform_info[0], ""
|
||||
else:
|
||||
[operating_system, version_arch] = platform_info
|
||||
if "-" in version_arch:
|
||||
# Ex: macosx-11.2-arm64
|
||||
version, architecture = version_arch.rsplit("-", 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue