Add check_effective_target_python3_module.
authorMartin Liska <mliska@suse.cz>
Tue, 18 Jan 2022 09:31:15 +0000 (10:31 +0100)
committerMartin Liska <mliska@suse.cz>
Tue, 18 Jan 2022 09:32:39 +0000 (10:32 +0100)
gcc/testsuite/ChangeLog:

* gcc.src/maintainers.exp: Use
check_effective_target_python3_module for checking of unicode
module.
* lib/target-supports.exp: Add
check_effective_target_python3_module.

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

index a4b3986..045f7ec 100644 (file)
@@ -29,6 +29,12 @@ proc gcc_src_run_maintainers_verify_sh {} {
       return
     }
 
+    if { ![check_effective_target_python3_module "unidecode"] } {
+      unsupported "$script 'unidecode' python3 module is missing"
+      return
+    }
+
+
     set result [remote_exec host $contrib/$script $maintainers]
     set status [lindex $result 0]
     if { $status == 0 } then {
index fbb6c73..cffcdb5 100644 (file)
@@ -11735,6 +11735,18 @@ proc check_effective_target_recent_python3 { } {
     }
 }
 
+# Return 1 if python3 contains a module
+
+proc check_effective_target_python3_module { module } {
+    set result [remote_exec host "python3 -c \"import $module\""]
+    set status [lindex $result 0]
+    if { $status == 0 } then {
+        return 1;
+    } else {
+        return 0;
+    }
+}
+
 # Return 1 if pytest module is available for python3.
 
 proc check_effective_target_pytest3 { } {