Ignore:
Timestamp:
12/30/08 09:55:47 (6 years ago)
Author:
xi
Message:

Minor compatibility fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/tests/lib/test_input_output.py

    r334 r335  
    55def _unicode_open(file, encoding, errors='strict'): 
    66    info = codecs.lookup(encoding) 
    7     srw = codecs.StreamReaderWriter(file, info.streamreader, info.streamwriter, errors) 
     7    if isinstance(info, tuple): 
     8        reader = info[2] 
     9        writer = info[3] 
     10    else: 
     11        reader = info.streamreader 
     12        writer = info.streamwriter 
     13    srw = codecs.StreamReaderWriter(file, reader, writer, errors) 
    814    srw.encoding = encoding 
    915    return srw 
Note: See TracChangeset for help on using the changeset viewer.