diff --git a/flask_fixtures/loaders.py b/flask_fixtures/loaders.py index a8b970b..2d9f98d 100644 --- a/flask_fixtures/loaders.py +++ b/flask_fixtures/loaders.py @@ -35,10 +35,11 @@ def dtparse(dtstring): try: import yaml except ImportError: - def load(self, filename): + def load(self, filename, Loader=None): raise Exception("Could not load fixture '{0}'. Make sure you have PyYAML installed.".format(filename)) yaml = type('FakeYaml', (object,), { - 'load': load + 'load': load, + 'loader': type('FakeLoader', (object,), {'FullLoader': None})() })() @@ -74,7 +75,7 @@ class YAMLLoader(FixtureLoader): def load(self, filename): with open(filename) as fin: - return yaml.load(fin) + return yaml.load(fin, yaml.loader.FullLoader) def load(filename):