aboutsummaryrefslogtreecommitdiff
path: root/lib3
diff options
context:
space:
mode:
authorTina Müller (tinita) <cpan2@tinita.de>2019-12-07 22:40:48 +0100
committerGitHub <noreply@github.com>2019-12-07 22:40:48 +0100
commit03b378d0390c6e5538741196e60b70f5be27fc5b (patch)
treea8f712b2cf71830e4fe2e4693477a871d839b6ed /lib3
parent5a0cfab86f6bccd5e5bec5c239ccfb94f8f0fe11 (diff)
downloadpyyaml-03b378d0390c6e5538741196e60b70f5be27fc5b.tar.gz
Allow add_multi_constructor with None (#358)
Loader.add_multi_constructor(None, myconstructor) Also add test for add_multi_constructor('!', ...) etc. See issue #317
Diffstat (limited to 'lib3')
-rw-r--r--lib3/yaml/constructor.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib3/yaml/constructor.py b/lib3/yaml/constructor.py
index 31e9318..ac15aba 100644
--- a/lib3/yaml/constructor.py
+++ b/lib3/yaml/constructor.py
@@ -72,7 +72,7 @@ class BaseConstructor:
constructor = self.yaml_constructors[node.tag]
else:
for tag_prefix in self.yaml_multi_constructors:
- if node.tag.startswith(tag_prefix):
+ if tag_prefix is not None and node.tag.startswith(tag_prefix):
tag_suffix = node.tag[len(tag_prefix):]
constructor = self.yaml_multi_constructors[tag_prefix]
break