summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTina Müller <cpan2@tinita.de>2019-11-18 15:55:27 +0100
committerTina Müller <cpan2@tinita.de>2019-11-18 15:55:27 +0100
commitc5cd5bddba5440bbe19546f83fffda2dc17dd019 (patch)
treec063aa57c84d2081ae743716cade3b9bc092b4ed
parent4a31b16b04c08f926f01d3f297140634665f004a (diff)
downloadpyyaml-git-perlpunk/unsafe-apply.tar.gz
Move constructor for object/apply to Unsafeperlpunk/unsafe-apply
-rw-r--r--lib/yaml/constructor.py8
-rw-r--r--lib3/yaml/constructor.py8
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/yaml/constructor.py b/lib/yaml/constructor.py
index 516dad1..859c949 100644
--- a/lib/yaml/constructor.py
+++ b/lib/yaml/constructor.py
@@ -684,10 +684,6 @@ FullConstructor.add_multi_constructor(
FullConstructor.construct_python_object)
FullConstructor.add_multi_constructor(
- u'tag:yaml.org,2002:python/object/apply:',
- FullConstructor.construct_python_object_apply)
-
-FullConstructor.add_multi_constructor(
u'tag:yaml.org,2002:python/object/new:',
FullConstructor.construct_python_object_new)
@@ -703,6 +699,10 @@ class UnsafeConstructor(FullConstructor):
return super(UnsafeConstructor, self).make_python_instance(
suffix, node, args, kwds, newobj, unsafe=True)
+UnsafeConstructor.add_multi_constructor(
+ u'tag:yaml.org,2002:python/object/apply:',
+ UnsafeConstructor.construct_python_object_apply)
+
# Constructor is same as UnsafeConstructor. Need to leave this in place in case
# people have extended it directly.
class Constructor(UnsafeConstructor):
diff --git a/lib3/yaml/constructor.py b/lib3/yaml/constructor.py
index 34fc1ae..fb4f1e9 100644
--- a/lib3/yaml/constructor.py
+++ b/lib3/yaml/constructor.py
@@ -695,10 +695,6 @@ FullConstructor.add_multi_constructor(
FullConstructor.construct_python_object)
FullConstructor.add_multi_constructor(
- 'tag:yaml.org,2002:python/object/apply:',
- FullConstructor.construct_python_object_apply)
-
-FullConstructor.add_multi_constructor(
'tag:yaml.org,2002:python/object/new:',
FullConstructor.construct_python_object_new)
@@ -714,6 +710,10 @@ class UnsafeConstructor(FullConstructor):
return super(UnsafeConstructor, self).make_python_instance(
suffix, node, args, kwds, newobj, unsafe=True)
+UnsafeConstructor.add_multi_constructor(
+ 'tag:yaml.org,2002:python/object/apply:',
+ UnsafeConstructor.construct_python_object_apply)
+
# Constructor is same as UnsafeConstructor. Need to leave this in place in case
# people have extended it directly.
class Constructor(UnsafeConstructor):