diff options
Diffstat (limited to 'libs/python/src/str.cpp')
-rw-r--r-- | libs/python/src/str.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/python/src/str.cpp b/libs/python/src/str.cpp index 1b7e59cd9b..0bc225aa22 100644 --- a/libs/python/src/str.cpp +++ b/libs/python/src/str.cpp @@ -9,14 +9,14 @@ namespace boost { namespace python { namespace detail { detail::new_reference str_base::call(object const& arg_) { + return (detail::new_reference)PyObject_CallFunction( #if PY_VERSION_HEX >= 0x03000000 - union { PyTypeObject *ptop; PyObject *pop; }pun = { &PyUnicode_Type }; + (PyObject*)&PyUnicode_Type, #else - union { PyTypeObject *ptop; PyObject *pop; }pun = { &PyString_Type }; + (PyObject*)&PyString_Type, #endif - - return (detail::new_reference)PyObject_CallFunction( - pun.pop, const_cast<char*>("(O)"), arg_.ptr()); + const_cast<char*>("(O)"), + arg_.ptr()); } str_base::str_base() |