diff options
Diffstat (limited to 'test/lib/ansible_test/_internal/util_common.py')
-rw-r--r-- | test/lib/ansible_test/_internal/util_common.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/test/lib/ansible_test/_internal/util_common.py b/test/lib/ansible_test/_internal/util_common.py index 77a6165c..222366e4 100644 --- a/test/lib/ansible_test/_internal/util_common.py +++ b/test/lib/ansible_test/_internal/util_common.py @@ -88,7 +88,7 @@ class ExitHandler: try: func(*args, **kwargs) - except BaseException as ex: # pylint: disable=broad-exception-caught + except BaseException as ex: # pylint: disable=broad-except last_exception = ex display.fatal(f'Exit handler failed: {ex}') @@ -498,14 +498,9 @@ def run_command( ) -def yamlcheck(python: PythonConfig, explain: bool = False) -> t.Optional[bool]: +def yamlcheck(python: PythonConfig) -> t.Optional[bool]: """Return True if PyYAML has libyaml support, False if it does not and None if it was not found.""" - stdout = raw_command([python.path, os.path.join(ANSIBLE_TEST_TARGET_TOOLS_ROOT, 'yamlcheck.py')], capture=True, explain=explain)[0] - - if explain: - return None - - result = json.loads(stdout) + result = json.loads(raw_command([python.path, os.path.join(ANSIBLE_TEST_TARGET_TOOLS_ROOT, 'yamlcheck.py')], capture=True)[0]) if not result['yaml']: return None |