From 18e56d688e73f8115bbe3413b3be16da077344e0 Mon Sep 17 00:00:00 2001 From: xi Date: Tue, 30 Dec 2008 14:55:47 +0000 Subject: Minor compatibility fixes. git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@335 18f92427-320e-0410-9341-c67f048884a3 --- ext/_yaml.h | 2 +- setup.cfg | 5 +++++ tests/lib/test_input_output.py | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ext/_yaml.h b/ext/_yaml.h index 3583e01..3e664f0 100644 --- a/ext/_yaml.h +++ b/ext/_yaml.h @@ -3,7 +3,7 @@ #if PY_MAJOR_VERSION < 3 -#define PyUnicode_FromString(s) PyUnicode_DecodeUTF8((s), strlen(s), 'strict') +#define PyUnicode_FromString(s) PyUnicode_DecodeUTF8((s), strlen(s), "strict") #else diff --git a/setup.cfg b/setup.cfg index 773c4d0..737dc9e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,3 +33,8 @@ #library_dirs=../../../libyaml/tags/0.1.2/win32/vs2008/output/release/lib #define=YAML_DECLARE_STATIC +# The following options are used to build PyYAML Windows installer +# for Python 3.0 on my PC: +#include_dirs=../../../libyaml/tags/0.1.2/include +#library_dirs=../../../libyaml/tags/0.1.2/win32/vs2008/output/release/lib +#define=YAML_DECLARE_STATIC diff --git a/tests/lib/test_input_output.py b/tests/lib/test_input_output.py index 311d0cf..0e9621e 100644 --- a/tests/lib/test_input_output.py +++ b/tests/lib/test_input_output.py @@ -4,7 +4,13 @@ import codecs, StringIO def _unicode_open(file, encoding, errors='strict'): info = codecs.lookup(encoding) - srw = codecs.StreamReaderWriter(file, info.streamreader, info.streamwriter, errors) + if isinstance(info, tuple): + reader = info[2] + writer = info[3] + else: + reader = info.streamreader + writer = info.streamwriter + srw = codecs.StreamReaderWriter(file, reader, writer, errors) srw.encoding = encoding return srw -- cgit v1.2.1