Catch ImportError when pyyaml doesn't have libyaml extension (#77434)

This commit is contained in:
Matt Martz
2022-03-31 14:16:47 -05:00
committed by GitHub
parent 26149c45df
commit e3aa73cb97

View File

@ -27,7 +27,7 @@ if HAS_YAML:
from yaml.cyaml import CParser as Parser
HAS_LIBYAML = True
except AttributeError:
except (ImportError, AttributeError):
from yaml import SafeLoader # type: ignore[misc]
from yaml import SafeDumper # type: ignore[misc]
from yaml.parser import Parser # type: ignore[misc]