ASP-based solver: suppress warnings when constructing facts (#23090)
fixes #22786 Trying to get optimization flags for a specific target from a compiler may trigger warnings. In the context of constructing facts for the ASP-based solver we don't want to show these warnings to the user, so here we simply ignore them.
This commit is contained in:
parent
4ee3934fb3
commit
9a473d6ab3
1 changed files with 4 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import types
|
import types
|
||||||
|
import warnings
|
||||||
from six import string_types
|
from six import string_types
|
||||||
|
|
||||||
import archspec.cpu
|
import archspec.cpu
|
||||||
|
@ -1040,7 +1041,9 @@ def _supported_targets(self, compiler_name, compiler_version, targets):
|
||||||
|
|
||||||
for target in targets:
|
for target in targets:
|
||||||
try:
|
try:
|
||||||
target.optimization_flags(compiler_name, compiler_version)
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
|
target.optimization_flags(compiler_name, compiler_version)
|
||||||
supported.append(target)
|
supported.append(target)
|
||||||
except archspec.cpu.UnsupportedMicroarchitecture:
|
except archspec.cpu.UnsupportedMicroarchitecture:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue