]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Update check_effective_target_recent_python3
authorMartin Liska <mliska@suse.cz>
Tue, 18 Jan 2022 08:16:26 +0000 (09:16 +0100)
committerMartin Liska <mliska@suse.cz>
Tue, 18 Jan 2022 08:16:26 +0000 (09:16 +0100)
Require at least Python 3.6.

gcc/testsuite/ChangeLog:

* gcc.src/maintainers.exp: Use the new
check_effective_target_recent_python3.
* lib/target-supports.exp: Check for Python3 version >= 3.6.

gcc/testsuite/gcc.src/maintainers.exp
gcc/testsuite/lib/target-supports.exp

index 63361dd5e4b37c31c3317cf5b00dc5600a7abf6e..a4b3986be777a7f8687bbef47f81880f2c11d2bb 100644 (file)
@@ -24,8 +24,8 @@ proc gcc_src_run_maintainers_verify_sh {} {
     set contrib $rootdir/contrib
     set maintainers $rootdir/MAINTAINERS
 
-    if { ![check_effective_target_python3] } {
-      unsupported "$script python3 is missing"
+    if { ![check_effective_target_recent_python3] } {
+      unsupported "$script recent python3 is missing"
       return
     }
 
index fd48475a57c98f553d0b1b8685a2cf07521c4b4f..fbb6c7352237bb489b0d9aa9798647bea793be38 100644 (file)
@@ -11723,10 +11723,10 @@ proc check_effective_target___OPTIMIZE__ {} {
     } [current_compiler_flags]]
 }
 
-# Return 1 if python3 is available.
+# Return 1 if python3 (>= 3.6) is available.
 
-proc check_effective_target_python3 { } {
-    set result [remote_exec host "python3 --version"]
+proc check_effective_target_recent_python3 { } {
+    set result [remote_exec host "python3 -c \"import sys; assert sys.version_info >= (3, 6)\""]
     set status [lindex $result 0]
     if { $status == 0 } then {
         return 1;