summaryrefslogtreecommitdiffstats
path: root/src/debputy/yaml/compat.py
blob: f26af0259c93cbf39e3c3bf5b4ceaf2bdd83a548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
__all__ = [
    "YAML",
    "YAMLError",
    "MarkedYAMLError",
    "Node",
    "LineCol",
    "CommentedBase",
    "CommentedMap",
    "CommentedSeq",
]

try:
    from ruyaml import YAMLError, YAML, Node
    from ruyaml.comments import LineCol, CommentedBase, CommentedMap, CommentedSeq
    from ruyaml.error import MarkedYAMLError
except (ImportError, ModuleNotFoundError):
    from ruamel.yaml import YAMLError, YAML, Node
    from ruamel.yaml.comments import LineCol, CommentedBase, CommentedMap, CommentedSeq
    from ruamel.yaml.error import MarkedYAMLError