Skip to content

Commit 61d3488

Browse files
authored
Merge pull request #228 from wbsch/fix-yaml-extension-handling
Fix .yml not being recognized by deep CLI
2 parents 9378a5a + 1134de4 commit 61d3488

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deepdiff/serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def load_path_content(path, file_type=None):
364364
if file_type == 'json':
365365
with open(path, 'r') as the_file:
366366
content = json.load(the_file)
367-
elif file_type in {'yaml', '.yml'}:
367+
elif file_type in {'yaml', 'yml'}:
368368
if yaml is None: # pragma: no cover.
369369
raise ImportError('Pyyaml needs to be installed.') # pragma: no cover.
370370
with open(path, 'r') as the_file:
@@ -426,7 +426,7 @@ def _save_content(content, path, file_type, keep_backup=True):
426426
if file_type == 'json':
427427
with open(path, 'w') as the_file:
428428
content = json.dump(content, the_file)
429-
elif file_type in {'yaml', '.yml'}:
429+
elif file_type in {'yaml', 'yml'}:
430430
if yaml is None: # pragma: no cover.
431431
raise ImportError('Pyyaml needs to be installed.') # pragma: no cover.
432432
with open(path, 'w') as the_file:

0 commit comments

Comments
 (0)