summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTina Müller <cpan2@tinita.de>2019-03-17 00:47:15 +0100
committerTina Müller <cpan2@tinita.de>2019-03-17 01:03:13 +0100
commita5d3740ae685e7c94cf1cf206f0c43a951b59aa3 (patch)
treeeb00c9b59875758963d1d2c94a82284b3d04f33d
parente471e86bf6dabdad45a1438c20a4a5c033eb9034 (diff)
downloadpyyaml-git-perlpunk/add_constructor.tar.gz
Change default Loader for add_constructor to FullLoaderperlpunk/add_constructor
-rw-r--r--lib/yaml/__init__.py2
-rw-r--r--lib3/yaml/__init__.py2
-rw-r--r--tests/lib/test_constructor.py2
-rw-r--r--tests/lib3/test_constructor.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/yaml/__init__.py b/lib/yaml/__init__.py
index e7a419d..7b8d7d8 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 5df0bb5..bd96246 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 beee7b0..ffdc35b 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 427f53c..8a556c0 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