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

Fixed Python 3.1 incompatibility issues.

Files:
1 modified

Legend:

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

    r329 r361  
    286286                    node.start_mark) 
    287287        try: 
    288             return base64.decodestring(value) 
     288            if hasattr(base64, 'decodebytes'): 
     289                return base64.decodebytes(value) 
     290            else: 
     291                return base64.decodestring(value) 
    289292        except binascii.Error as exc: 
    290293            raise ConstructorError(None, None, 
     
    478481                    node.start_mark) 
    479482        try: 
    480             return base64.decodestring(value) 
     483            if hasattr(base64, 'decodebytes'): 
     484                return base64.decodebytes(value) 
     485            else: 
     486                return base64.decodestring(value) 
    481487        except binascii.Error as exc: 
    482488            raise ConstructorError(None, None,