diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-09-20 19:29:12 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:15 -0300 |
commit | 2d8f8d8ac79bc6f266564afd7d0ffe702a7cdf58 (patch) | |
tree | d23a3316ae0382685fb6150ca5261b387a5b4ec7 /libshiboken | |
parent | 0b1f8df512047c6ace60701180ec1e4f6e97484e (diff) |
Fix SbkDbg() << PyObject on Python 3.x
Diffstat (limited to 'libshiboken')
-rw-r--r-- | libshiboken/sbkdbg.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libshiboken/sbkdbg.h b/libshiboken/sbkdbg.h index b671caeab..e5413c076 100644 --- a/libshiboken/sbkdbg.h +++ b/libshiboken/sbkdbg.h @@ -71,6 +71,11 @@ inline std::ostream& operator<<(std::ostream& out, PyObject* obj) { PyObject* repr = Shiboken::Object::isValid(obj, false) ? PyObject_Repr(obj) : 0; if (repr) { +#ifdef IS_PY3K + PyObject* str = PyUnicode_AsUTF8String(repr); + Py_DECREF(repr); + repr = str; +#endif out << PyBytes_AS_STRING(repr); Py_DECREF(repr); } else { |