Skip to content

Commit 1152ee1

Browse files
committed
going back to new pybind11::str::raw_str implementation
1 parent 442f205 commit 1152ee1

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

include/pybind11/pytypes.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -928,21 +928,12 @@ class str : public object {
928928
private:
929929
/// Return string representation -- always returns a new reference, even if already a str
930930
static PyObject *raw_str(PyObject *op) {
931-
#ifdef PYBIND11_STR_RAW_STR_PY2_EMULATE_UNICODE_CONSTRUCTOR_NOT_IMPLICIT_ENCODE
932931
#if PY_MAJOR_VERSION < 3
933932
PyObject *str_value = PyObject_Unicode(op);
934933
#else
935934
PyObject *str_value = PyObject_Str(op);
936935
#endif
937936
if (!str_value) throw error_already_set();
938-
#else
939-
PyObject *str_value = PyObject_Str(op);
940-
if (!str_value) throw error_already_set();
941-
#if PY_MAJOR_VERSION < 3
942-
PyObject *unicode = PyUnicode_FromEncodedObject(str_value, "utf-8", nullptr);
943-
Py_XDECREF(str_value); str_value = unicode;
944-
#endif
945-
#endif
946937
return str_value;
947938
}
948939
};

0 commit comments

Comments
 (0)