Ignore:
Timestamp:
08/30/09 15:32:07 (5 years ago)
Author:
xi
Message:

Fixed Python 3.1 incompatibility issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/ext/_yaml.pyx

    r350 r361  
    955955        self.stream = stream 
    956956        self.dump_unicode = 0 
    957         try: 
    958             if stream.encoding: 
     957        if PY_MAJOR_VERSION < 3: 
     958            if hasattr(stream, 'encoding'): 
    959959                self.dump_unicode = 1 
    960         except AttributeError: 
    961             pass 
     960        else: 
     961            if hasattr(stream, u'encoding'): 
     962                self.dump_unicode = 1 
    962963        self.use_encoding = encoding 
    963964        yaml_emitter_set_output(&self.emitter, output_handler, <void *>self)     
Note: See TracChangeset for help on using the changeset viewer.