1. Kirill Simonov
  2. pyyaml

Source

pyyaml / lib / yaml / resolver.py

Diff from to

File lib/yaml/resolver.py

     add_path_resolver = classmethod(add_path_resolver)
 
     def descend_resolver(self, current_node, current_index):
+        if not self.yaml_path_resolvers:
+            return
         exact_paths = {}
         prefix_paths = []
         if current_node:
         self.resolver_prefix_paths.append(prefix_paths)
 
     def ascend_resolver(self):
+        if not self.yaml_path_resolvers:
+            return
         self.resolver_exact_paths.pop()
         self.resolver_prefix_paths.pop()
 
                 if regexp.match(value):
                     return tag
             implicit = implicit[1]
-        exact_paths = self.resolver_exact_paths[-1]
-        if kind in exact_paths:
-            return exact_paths[kind]
-        if None in exact_paths:
-            return exact_paths[None]
+        if self.yaml_path_resolvers:
+            exact_paths = self.resolver_exact_paths[-1]
+            if kind in exact_paths:
+                return exact_paths[kind]
+            if None in exact_paths:
+                return exact_paths[None]
         if kind is ScalarNode:
             return self.DEFAULT_SCALAR_TAG
         elif kind is SequenceNode: