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/lib3/yaml/representer.py

    r328 r361  
    145145 
    146146    def represent_binary(self, data): 
    147         data = base64.encodestring(data).decode('ascii') 
     147        if hasattr(base64, 'encodebytes'): 
     148            data = base64.encodebytes(data).decode('ascii') 
     149        else: 
     150            data = base64.encodestring(data).decode('ascii') 
    148151        return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|') 
    149152 
Note: See TracChangeset for help on using the changeset viewer.