gentoo/dev-libs/Ice/files/Ice-3.7.7-fix-python-versio...

36 lines
1.5 KiB
Diff

From 8daf1ed1f4ea0dd0f548d37875bdf5fbd7e9e950 Mon Sep 17 00:00:00 2001
From: Jose <pepone@users.noreply.github.com>
Date: Wed, 13 Jul 2022 09:08:03 +0200
Subject: [PATCH] Fix python version check (#1381)
---
python/config/Make.rules | 1 -
python/python/Makefile | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/python/config/Make.rules b/python/config/Make.rules
index 7a1c0f47480..d414db7933b 100644
--- a/python/config/Make.rules
+++ b/python/config/Make.rules
@@ -16,7 +16,6 @@ PYTHON ?= python3
-include $(lang_srcdir)/config/Make.rules.$(os)
# PYTHON must be set to a value that has a corresponding PYTHON-config
-python-version := $(shell $(PYTHON) -c "import sys; print(\"{0}.{1}\".format(sys.version_info[0], sys.version_info[1]))")
python-config := $(PYTHON)-config
ifeq ($(os),Linux)
diff --git a/python/python/Makefile b/python/python/Makefile
index f5bb725a3af..ba1df33e586 100644
--- a/python/python/Makefile
+++ b/python/python/Makefile
@@ -32,7 +32,7 @@ install:: | $(DESTDIR)$(install_pythondir)/Ice
$(E) "Installing generated code"
$(Q)$(INSTALL) -m 644 Ice/__init__.py $(DESTDIR)$(install_pythondir)/Ice
# Ice/Future requires python >= 3.5
-ifeq ($(shell $(PYTHON) -c "print(1 if $(python-version) >= 3.5 else 0)"),1)
+ifeq ($(shell $(PYTHON) -c "import sys; print(1 if sys.version_info[:2] >= (3, 5) else 0)"),1)
$(Q)$(MKDIR) -p -m 755 $(DESTDIR)$(install_pythondir)/Ice/Py3
$(Q)$(INSTALL) -m 644 Ice/Py3/IceFuture.py $(DESTDIR)$(install_pythondir)/Ice/Py3/
endif