From 40e7e1906c5a4b06161cf772af2ac386acc9c36c Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 11 Jan 2016 20:15:40 +0100 Subject: [PATCH] Fix Compile Error: str Naming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a build error compiling with nvcc/7.5 causing a ``` ./include/pybind11/pytypes.h: In member function ‘pybind11::str pybind11::handle::str() const’: ./include/pybind11/pytypes.h:292:8: error: expected primary-expression before ‘class’ return pybind11::str(str, false); ^ ./include/pybind11/pytypes.h:292:8: error: expected ‘;’ before ‘class’ ./include/pybind11/pytypes.h:292:8: error: expected primary-expression before ‘class’ ``` --- include/pybind11/pytypes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 8d84afac6..0d6263738 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -284,12 +284,12 @@ private: }; inline pybind11::str handle::str() const { - PyObject *str = PyObject_Str(m_ptr); + PyObject *myStr = PyObject_Str(m_ptr); #if PY_MAJOR_VERSION < 3 - PyObject *unicode = PyUnicode_FromEncodedObject(str, "utf-8", nullptr); - Py_XDECREF(str); str = unicode; + PyObject *unicode = PyUnicode_FromEncodedObject(myStr, "utf-8", nullptr); + Py_XDECREF(myStr); myStr = unicode; #endif - return pybind11::str(str, false); + return pybind11::str(myStr, false); } class bool_ : public object {