Skip to content

Commit

Permalink
Use yamllib if available
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Mar 13, 2024
1 parent 7c311d9 commit 31f192c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion linkml_runtime/utils/yamlutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

YAMLObjTypes = Union[JsonObjTypes, "YAMLRoot"]

try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml.loader import SafeLoader


class YAMLMark(yaml.error.Mark):
def __str__(self):
Expand Down Expand Up @@ -369,7 +374,7 @@ class extended_float(float, TypedNode):
pass


class DupCheckYamlLoader(yaml.loader.SafeLoader):
class DupCheckYamlLoader(SafeLoader):
"""
A YAML loader that throws an error when the same key appears twice
"""
Expand Down

0 comments on commit 31f192c

Please sign in to comment.