mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-18 06:30:54 +00:00
Fix Compile Error: str Naming
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’ ```
This commit is contained in:
parent
f08a3f0622
commit
40e7e1906c
@ -284,12 +284,12 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline pybind11::str handle::str() const {
|
inline pybind11::str handle::str() const {
|
||||||
PyObject *str = PyObject_Str(m_ptr);
|
PyObject *myStr = PyObject_Str(m_ptr);
|
||||||
#if PY_MAJOR_VERSION < 3
|
#if PY_MAJOR_VERSION < 3
|
||||||
PyObject *unicode = PyUnicode_FromEncodedObject(str, "utf-8", nullptr);
|
PyObject *unicode = PyUnicode_FromEncodedObject(myStr, "utf-8", nullptr);
|
||||||
Py_XDECREF(str); str = unicode;
|
Py_XDECREF(myStr); myStr = unicode;
|
||||||
#endif
|
#endif
|
||||||
return pybind11::str(str, false);
|
return pybind11::str(myStr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
class bool_ : public object {
|
class bool_ : public object {
|
||||||
|
Loading…
Reference in New Issue
Block a user