Skip to content

Commit

Permalink
fix: disable ruamel.yaml based backend if its lib is too old
Browse files Browse the repository at this point in the history
Disable ruamel.yaml based YAML backend if dependent ruamel.yaml library
is too old and does not have the definition of ruamel.yaml.YAML class,
necessary to make it works.

This fix was based on the report from the pr#97 by Masatake YAMATO.
  • Loading branch information
ssato committed Jan 30, 2019
1 parent 4bf65f9 commit c429c62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions anyconfig/backend/yaml/ruamel_yaml.py
Expand Up @@ -44,6 +44,11 @@
from . import pyyaml


try:
ryaml.YAML # flake8: noqa
except AttributeError:
ImportError("ruamel.yaml may be too old to use!")

_YAML_INIT_KWARGS = ["typ", "pure", "plug_ins"] # kwargs for ruamel.yaml.YAML
_YAML_INSTANCE_MEMBERS = ['allow_duplicate_keys', 'allow_unicode',
'block_seq_indent', 'canonical', 'composer',
Expand Down

0 comments on commit c429c62

Please sign in to comment.