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

pull/77439/head
Matt Martz 3 years ago committed by GitHub
parent 26149c45df
commit e3aa73cb97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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]

Loading…
Cancel
Save