[openwrt/openwrt] prereq-build: limit python distutils check to <v3.12

LEDE Commits lede-commits at lists.infradead.org
Wed Oct 16 13:36:48 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8191c8980f04087eaf2921dc327fff219999bd55

commit 8191c8980f04087eaf2921dc327fff219999bd55
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Mon Jan 9 16:38:05 2023 +0100

    prereq-build: limit python distutils check to <v3.12
    
    v3.12 won't have it anymore.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16699
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 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 2378f5ad90..8b138cfc44 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -201,7 +201,8 @@ $(eval $(call SetupHostCommand,python3,Please install Python >= 3.7, \
 
 $(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, \




More information about the lede-commits mailing list