We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b2f5222 commit 8b9eb96Copy full SHA for 8b9eb96
include/pybind11/pytypes.h
@@ -933,8 +933,8 @@ class str : public object {
933
/// Return string representation -- always returns a new reference, even if already a str
934
static PyObject *raw_str(PyObject *op) {
935
PyObject *str_value = PyObject_Str(op);
936
-#if PY_MAJOR_VERSION < 3
937
if (!str_value) throw error_already_set();
+#if PY_MAJOR_VERSION < 3
938
PyObject *unicode = PyUnicode_FromEncodedObject(str_value, "utf-8", nullptr);
939
Py_XDECREF(str_value); str_value = unicode;
940
#endif
0 commit comments