diff options
author | Tina Müller (tinita) <cpan2@tinita.de> | 2019-12-07 22:40:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-07 22:40:48 +0100 |
commit | 03b378d0390c6e5538741196e60b70f5be27fc5b (patch) | |
tree | a8f712b2cf71830e4fe2e4693477a871d839b6ed /lib3 | |
parent | 5a0cfab86f6bccd5e5bec5c239ccfb94f8f0fe11 (diff) | |
download | pyyaml-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.py | 2 |
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 |