diff options
author | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2008-12-30 14:55:47 +0000 |
---|---|---|
committer | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2008-12-30 14:55:47 +0000 |
commit | 18e56d688e73f8115bbe3413b3be16da077344e0 (patch) | |
tree | b6ec42f8be12edffaff86b2b16d592106a52e827 | |
parent | 1ade43b5ac1f866ace28edd4c3a5dddfbf4e01eb (diff) | |
download | pyyaml-18e56d688e73f8115bbe3413b3be16da077344e0.tar.gz |
Minor compatibility fixes.
git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@335 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r-- | ext/_yaml.h | 2 | ||||
-rw-r--r-- | setup.cfg | 5 | ||||
-rw-r--r-- | 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 @@ -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 |