diff --git a/gwinc/struct.py b/gwinc/struct.py index 26594597436674ef31a2e6cf5d0b06a5e170cc31..07a722e71ad5d2fd94c9738cb817bc76c3c7fdfb 100644 --- a/gwinc/struct.py +++ b/gwinc/struct.py @@ -276,7 +276,7 @@ class Struct(object): """Create Struct from YAML string. """ - d = yaml.load(y) + d = yaml.load(y, Loader=yaml_loader) return cls.from_dict(d) @@ -320,8 +320,7 @@ class Struct(object): with open(path, 'r') as f: if ext in ['.yaml', '.yml']: - d = yaml.load(f, Loader=yaml_loader) - return cls.from_dict(d) + return cls.from_yaml(f) elif ext == '.mat': s = loadmat(f, squeeze_me=True, struct_as_record=False) return cls.from_matstruct(s)