From 8bddbc9a944965c431bbef4c0158f5581575791e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 31 Oct 2022 19:31:58 +0100 Subject: Fix bpy wheel build error on Windows, where there are no abi flags --- build_files/utils/make_bpy_wheel.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build_files/utils/make_bpy_wheel.py b/build_files/utils/make_bpy_wheel.py index ba1d0f21937..81d267c6e10 100755 --- a/build_files/utils/make_bpy_wheel.py +++ b/build_files/utils/make_bpy_wheel.py @@ -208,12 +208,15 @@ def main() -> None: dist_dir = os.path.join(install_dir, "dist") for f in os.listdir(dist_dir): if f.endswith(".whl"): - # No apparent way to override this ABI version with setuptools, so rename. - sys_py = "cp%d%d" % (sys.version_info.major, sys.version_info.minor) - sys_py_abi = sys_py + sys.abiflags blender_py = "cp%d%d" % (python_version_number[0], python_version_number[1]) - renamed_f = f.replace(sys_py_abi, blender_py).replace(sys_py, blender_py) + # No apparent way to override this ABI version with setuptools, so rename. + sys_py = "cp%d%d" % (sys.version_info.major, sys.version_info.minor) + if hasattr(sys, "abiflags"): + sys_py_abi = sys_py + sys.abiflags + renamed_f = f.replace(sys_py_abi, blender_py).replace(sys_py, blender_py) + else: + renamed_f = f.replace(sys_py, blender_py) os.rename(os.path.join(dist_dir, f), os.path.join(output_dir, renamed_f)) -- cgit v1.2.3