diff options
-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 |