Changeset 335


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

Minor compatibility fixes.

Location:
pyyaml/trunk
Files:
3 edited

Legend:

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

    r334 r335  
    44#if PY_MAJOR_VERSION < 3 
    55 
    6 #define PyUnicode_FromString(s) PyUnicode_DecodeUTF8((s), strlen(s), 'strict') 
     6#define PyUnicode_FromString(s) PyUnicode_DecodeUTF8((s), strlen(s), "strict") 
    77 
    88#else 
  • pyyaml/trunk/setup.cfg

    r322 r335  
    3434#define=YAML_DECLARE_STATIC 
    3535 
     36# The following options are used to build PyYAML Windows installer 
     37# for Python 3.0 on my PC: 
     38#include_dirs=../../../libyaml/tags/0.1.2/include 
     39#library_dirs=../../../libyaml/tags/0.1.2/win32/vs2008/output/release/lib 
     40#define=YAML_DECLARE_STATIC 
  • 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.