From 46df49e93f4321bd800c7c835b4a9a66f6db525e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 12 Nov 2022 13:27:58 -0600 Subject: [PATCH 1/2] Fix _32_BIT_INTERPRETER for GraalPy On GraalPy's 64-bit interpreter, `sys.maxsize` is `2**31-1` because Java arrays can be indexed only with 32-bit indices. --- packaging/tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/tags.py b/packaging/tags.py index a0e1ea23..21f6f26c 100644 --- a/packaging/tags.py +++ b/packaging/tags.py @@ -37,7 +37,7 @@ } -_32_BIT_INTERPRETER = sys.maxsize <= 2**32 +_32_BIT_INTERPRETER = (struct.calcsize("P") == 4) class Tag: From fbb39e8b78187b0456a9656eb2e454f637d53198 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 12 Nov 2022 13:46:04 -0600 Subject: [PATCH 2/2] import struct --- packaging/tags.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/tags.py b/packaging/tags.py index 21f6f26c..4314cb33 100644 --- a/packaging/tags.py +++ b/packaging/tags.py @@ -4,6 +4,7 @@ import logging import platform +import struct import subprocess import sys import sysconfig