[pywin32-checkins] /hgrepo/p/py/pywin32/pywin32: get ISAPI building on python 3.3 (...
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2011-03-31 01:15:01
|
changeset e4fd5f1a855c in /hgrepo/p/py/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgrepo/p/py/pywin32/pywin32?cmd=changeset;node=e4fd5f1a855c summary: get ISAPI building on python 3.3 (bug 3260092) diffstat: isapi/src/Utils.cpp | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diffs (20 lines): diff -r ff9086ad5e86 -r e4fd5f1a855c isapi/src/Utils.cpp --- a/isapi/src/Utils.cpp Sat Mar 19 15:23:54 2011 +1100 +++ b/isapi/src/Utils.cpp Thu Mar 31 12:13:43 2011 +1100 @@ -38,7 +38,16 @@ #if (PY_VERSION_HEX >= 0x03000000) // py3k - check for unicode object and use default encoding. if (PyUnicode_Check(ob)) { + // NOTE: we are using an internal API and it may go away later. + // The implementation in py3k is simply "encode as utf-8" - but using + // this makes our life a little simpler (the value is cached and we + // don't need to manage reference counts) so we stick with it. + // Sadly this changed in 3.3 though... +#if (PY_VERSION_HEX >= 0x03030000) + ob = _PyUnicode_AsDefaultEncodedString(ob); +#else ob = _PyUnicode_AsDefaultEncodedString(ob, NULL); +#endif if (ob == NULL) return NULL; } |