Changeset 142 for pyyaml/trunk/lib/yaml/constructor.py
- Timestamp:
- 04/18/06 13:15:54 (7 years ago)
- File:
-
- 1 edited
-
pyyaml/trunk/lib/yaml/constructor.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/lib/yaml/constructor.py
r139 r142 30 30 def __init__(self): 31 31 self.constructed_objects = {} 32 self.recursive_objects = {} 32 33 33 34 def check_data(self): … … 48 49 data = self.construct_object(node) 49 50 self.constructed_objects = {} 51 self.recursive_objects = {} 50 52 return data 51 53 … … 53 55 if node in self.constructed_objects: 54 56 return self.constructed_objects[node] 57 if node in self.recursive_objects: 58 raise ConstructorError(None, None, 59 "found recursive node", node.start_mark) 60 self.recursive_objects[node] = None 55 61 constructor = None 56 62 if node.tag in self.yaml_constructors: … … 80 86 data = constructor(node) 81 87 self.constructed_objects[node] = data 88 del self.recursive_objects[node] 82 89 return data 83 90
Note: See TracChangeset
for help on using the changeset viewer.
