We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 255f9ad commit 538e2f8Copy full SHA for 538e2f8
include/pybind11/detail/common.h
@@ -168,7 +168,9 @@
168
// If DEFINED, pybind11::str can only hold PyUnicodeObject, and
169
// pybind11::isinstance<str>() is true only for pybind11::str.
170
171
-//#define PYBIND11_STR_CASTER_NO_IMPLICIT_DECODE
+#if PY_MAJOR_VERSION >= 3
172
+#define PYBIND11_STR_CASTER_NO_IMPLICIT_DECODE
173
+#endif
174
// This macro has an effect only if PYBIND11_STR_NON_PERMISSIVE is defined.
175
// If UNDEFINED, the pybind11::str caster will implicitly decode bytes to PyUnicodeObject.
176
// If DEFINED, the pybind11::str caster will only accept PyUnicodeObject.
0 commit comments