diff options
| author | Alex Grönholm <alex.gronholm@nextday.fi> | 2021-12-24 21:59:48 +0200 |
|---|---|---|
| committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2021-12-24 21:59:48 +0200 |
| commit | 7d898b7bc57ec822d17eabf4b05f1d3098a13aab (patch) | |
| tree | c3e9054caf5a3b9d24b0348176eddc6b2d633449 | |
| parent | 55dfd587ed6182b8af224906a467dbd3f7ae1433 (diff) | |
| download | wheel-git-7d898b7bc57ec822d17eabf4b05f1d3098a13aab.tar.gz | |
Fixed detection of 32-bit Python on 64-bit OS
The sysconfig.get_platform() and distutils.util.get_platform() functions return "linux-x64_64", not "linux_x64_64" which the previous code and tests assumed.
| -rw-r--r-- | src/wheel/bdist_wheel.py | 4 | ||||
| -rw-r--r-- | tests/test_macosx_libfile.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py index bf2500c..d335952 100644 --- a/src/wheel/bdist_wheel.py +++ b/src/wheel/bdist_wheel.py @@ -55,9 +55,9 @@ def get_platform(archive_root): result = sysconfig.get_platform() if result.startswith("macosx") and archive_root is not None: result = calculate_macosx_platform_tag(archive_root, result) - if result == "linux_x86_64" and sys.maxsize == 2147483647: + elif result == "linux-x86_64" and sys.maxsize == 2147483647: # pip pull request #3497 - result = "linux_i686" + result = "linux-i686" return result.replace("-", "_") diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index 6e3bfd4..941738e 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -213,6 +213,6 @@ class TestGetPlatformMacosx: def test_get_platform_linux(monkeypatch): - monkeypatch.setattr(sysconfig, "get_platform", return_factory("linux_x86_64")) + monkeypatch.setattr(sysconfig, "get_platform", return_factory("linux-x86_64")) monkeypatch.setattr(sys, "maxsize", 2147483647) assert get_platform(None) == "linux_i686" |
