Ignore:
Timestamp:
12/08/06 10:36:53 (8 years ago)
Author:
xi
Message:

Use the types module instead of constructing type objects by hand. Fix #41. Thanks to v.haisman@… for the patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/lib/yaml/constructor.py

    r234 r235  
    1313    from sets import Set as set 
    1414 
    15 import binascii, re, sys 
     15import binascii, re, sys, types 
    1616 
    1717class ConstructorError(MarkedYAMLError): 
     
    3737        if self.check_node(): 
    3838            return self.construct_document(self.get_node()) 
    39  
    40     def g(): yield None 
    41     generator_type = type(g()) 
    42     del g 
    4339 
    4440    def construct_document(self, node): 
     
    9288        else: 
    9389            data = constructor(self, tag_suffix, node) 
    94         if isinstance(data, self.generator_type): 
     90        if isinstance(data, types.GeneratorType): 
    9591            generator = data 
    9692            data = generator.next() 
Note: See TracChangeset for help on using the changeset viewer.