From 235d6eec75e66328607749a0a3ffba700ceea90c Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Mon, 9 Jan 2023 16:38:05 +0100 Subject: [PATCH] prereq-build: limit python distutils check to Link: https://github.com/openwrt/openwrt/pull/16699 Signed-off-by: Robert Marko (cherry picked from commit 8191c8980f04087eaf2921dc327fff219999bd55) Link: https://github.com/openwrt/openwrt/pull/19513 Signed-off-by: Hauke Mehrtens --- include/prereq-build.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index c5df77e0b45..94fc0f8e584 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -197,7 +197,8 @@ $(eval $(call SetupHostCommand,python3,Please install Python >= 3.6, \ $(eval $(call TestHostCommand,python3-distutils, \ Please install the Python3 distutils module, \ - $(STAGING_DIR_HOST)/bin/python3 -c 'from distutils import util')) + printf 'from sys import version_info\nif version_info < (3, 12):\n\tfrom distutils import util' | \ + $(STAGING_DIR_HOST)/bin/python3 -)) $(eval $(call TestHostCommand,python3-stdlib, \ Please install the Python3 stdlib module, \ -- 2.47.2