From 1134de4f76201936e121a9592bc04cf69ef5bcac Mon Sep 17 00:00:00 2001 From: Wilhelm Schuermann Date: Fri, 12 Feb 2021 20:54:40 +0100 Subject: [PATCH] Fix .yml not being recognized by deep CLI --- deepdiff/serialization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepdiff/serialization.py b/deepdiff/serialization.py index 4096387d..0c1ba81e 100644 --- a/deepdiff/serialization.py +++ b/deepdiff/serialization.py @@ -364,7 +364,7 @@ def load_path_content(path, file_type=None): if file_type == 'json': with open(path, 'r') as the_file: content = json.load(the_file) - elif file_type in {'yaml', '.yml'}: + elif file_type in {'yaml', 'yml'}: if yaml is None: # pragma: no cover. raise ImportError('Pyyaml needs to be installed.') # pragma: no cover. with open(path, 'r') as the_file: @@ -426,7 +426,7 @@ def _save_content(content, path, file_type, keep_backup=True): if file_type == 'json': with open(path, 'w') as the_file: content = json.dump(content, the_file) - elif file_type in {'yaml', '.yml'}: + elif file_type in {'yaml', 'yml'}: if yaml is None: # pragma: no cover. raise ImportError('Pyyaml needs to be installed.') # pragma: no cover. with open(path, 'w') as the_file: