aboutsummaryrefslogtreecommitdiffstats
path: root/config_file/parsers/yaml_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'config_file/parsers/yaml_parser.py')
-rw-r--r--config_file/parsers/yaml_parser.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/config_file/parsers/yaml_parser.py b/config_file/parsers/yaml_parser.py
index 4c39582..39dd2d6 100644
--- a/config_file/parsers/yaml_parser.py
+++ b/config_file/parsers/yaml_parser.py
@@ -18,14 +18,17 @@ class YamlParser(BaseParser):
@property
def decode_error(self) -> Type[Exception]:
from ruamel.yaml import YAMLError
+
return YAMLError
def loads(self, contents: str) -> dict:
from ruamel.yaml import YAML
+
return YAML().load(contents)
def dumps(self, loaded_contents: dict) -> str:
from ruamel.yaml import YAML
+
buffer = StringIO()
YAML().dump(loaded_contents, buffer)
return buffer.getvalue()