Skip to content

Commit 9c3f6f6

Browse files
authored
Merge pull request #51 from crcornwell/master
specify the loader in yaml.load call
2 parents b065799 + 3c0fe47 commit 9c3f6f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sqlalchemy_seed/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
import os
1515

1616
import yaml
17+
try:
18+
from yaml import CLoader as Loader
19+
except ImportError:
20+
from yaml import Loader
1721

1822
__version__ = '0.1.1'
1923

@@ -59,7 +63,7 @@ def load_fixture_files(paths, files):
5963

6064
with open(fixture_path, 'r') as f:
6165
if file.endswith('.yaml') or file.endswith('.yml'):
62-
data = yaml.load(f)
66+
data = yaml.load(f, Loader=Loader)
6367
elif file.endswith('.json'):
6468
data = json.loads(f)
6569
else:

0 commit comments

Comments
 (0)