From 8157f820faeb916997822e6370cec391ee2178e6 Mon Sep 17 00:00:00 2001
From: Jameson Graef Rollins <jrollins@finestructure.net>
Date: Wed, 5 Feb 2020 10:46:53 -0800
Subject: [PATCH] struct: fix yaml loader

and use in load_struct
---
 gwinc/struct.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gwinc/struct.py b/gwinc/struct.py
index 26594597..07a722e7 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)
-- 
GitLab