diff --git a/lib/yaml/__init__.py b/lib/yaml/__init__.py index e7a419dd2..7b8d7d8f6 100644 --- a/lib/yaml/__init__.py +++ b/lib/yaml/__init__.py @@ -329,7 +329,7 @@ def add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper): Loader.add_path_resolver(tag, path, kind) Dumper.add_path_resolver(tag, path, kind) -def add_constructor(tag, constructor, Loader=Loader): +def add_constructor(tag, constructor, Loader=FullLoader): """ Add a constructor for the given tag. Constructor is a function that accepts a Loader instance diff --git a/lib3/yaml/__init__.py b/lib3/yaml/__init__.py index 5df0bb5fd..bd96246c1 100644 --- a/lib3/yaml/__init__.py +++ b/lib3/yaml/__init__.py @@ -326,7 +326,7 @@ def add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper): Loader.add_path_resolver(tag, path, kind) Dumper.add_path_resolver(tag, path, kind) -def add_constructor(tag, constructor, Loader=Loader): +def add_constructor(tag, constructor, Loader=FullLoader): """ Add a constructor for the given tag. Constructor is a function that accepts a Loader instance diff --git a/tests/lib/test_constructor.py b/tests/lib/test_constructor.py index beee7b0a7..ffdc35b33 100644 --- a/tests/lib/test_constructor.py +++ b/tests/lib/test_constructor.py @@ -19,7 +19,7 @@ def _make_objects(): NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict, \ FixedOffset, today, execute - class MyLoader(yaml.Loader): + class MyLoader(yaml.FullLoader): pass class MyDumper(yaml.Dumper): pass diff --git a/tests/lib3/test_constructor.py b/tests/lib3/test_constructor.py index 427f53c30..8a556c024 100644 --- a/tests/lib3/test_constructor.py +++ b/tests/lib3/test_constructor.py @@ -16,7 +16,7 @@ def _make_objects(): NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict, \ FixedOffset, today, execute - class MyLoader(yaml.Loader): + class MyLoader(yaml.FullLoader): pass class MyDumper(yaml.Dumper): pass