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 0de68d4 commit 2ac4dbbCopy full SHA for 2ac4dbb
include/pybind11/detail/common.h
@@ -167,7 +167,9 @@
167
// If DEFINED, pybind11::str can only hold PyUnicodeObject, and
168
// pybind11::isinstance<str>() is true only for pybind11::str.
169
170
-//#define PYBIND11_STR_CASTER_NO_IMPLICIT_DECODE
+#if PY_MAJOR_VERSION >= 3
171
+#define PYBIND11_STR_CASTER_NO_IMPLICIT_DECODE
172
+#endif
173
// This macro has an effect only if PYBIND11_STR_NON_PERMISSIVE is defined.
174
// If UNDEFINED, the pybind11::str caster will implicitly decode bytes to PyUnicodeObject.
175
// If DEFINED, the pybind11::str caster will only accept PyUnicodeObject.
0 commit comments