浏览代码

prereq-build: limit python distutils check to <v3.12

v3.12 won't have it anymore.

Signed-off-by: Andre Heider <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16699
Signed-off-by: Robert Marko <[email protected]>
Andre Heider 2 年之前
父节点
当前提交
8191c8980f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      include/prereq-build.mk

+ 2 - 1
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, \