mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
Merge pull request #532 from efiop/master
dvc: switch from yaml to json for dir cache file
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import stat
|
||||
import yaml
|
||||
import json
|
||||
from checksumdir import dirhash
|
||||
|
||||
from dvc.system import System
|
||||
@@ -249,7 +249,7 @@ class Output(Dependency):
|
||||
|
||||
try:
|
||||
with open(path, 'r') as fd:
|
||||
d = yaml.safe_load(fd)
|
||||
d = json.load(fd)
|
||||
except Exception as exc:
|
||||
msg = u'Failed to load dir cache \'{}\''
|
||||
Logger.error(msg.format(relpath), exc)
|
||||
@@ -349,7 +349,7 @@ class Output(Dependency):
|
||||
os.makedirs(dname)
|
||||
|
||||
with open(self.cache, 'w+') as fd:
|
||||
yaml.safe_dump(dir_info, fd, default_flow_style=False)
|
||||
json.dump(dir_info, fd)
|
||||
|
||||
def save(self):
|
||||
super(Output, self).save()
|
||||
|
||||
Reference in New Issue
Block a user