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 8bd4245 commit 0dc4005Copy full SHA for 0dc4005
include/libpy/to_object.h
@@ -142,7 +142,7 @@ struct to_object<std::filesystem::path> {
142
static py::owned_ref<> f(const std::filesystem::path& path) {
143
py::owned_ref path_str{
144
PyUnicode_FromStringAndSize(path.c_str(), path.native().length())};
145
-#if PY_VERSION_HEX >= 0x03040000
+
146
py::owned_ref pathlib(PyImport_ImportModule("pathlib"));
147
if (!pathlib) {
148
throw py::exception();
@@ -158,9 +158,6 @@ struct to_object<std::filesystem::path> {
158
159
}
160
return path_obj;
161
-#else
162
- return path_str;
163
-#endif
164
165
};
166
0 commit comments