| 36 | |
| 37 | private: |
| 38 | static PyObject *unicode_from_fs_native(const std::string &w) { |
| 39 | # if !defined(PYPY_VERSION) |
| 40 | return PyUnicode_DecodeFSDefaultAndSize(w.c_str(), ssize_t(w.size())); |
| 41 | # else |
| 42 | // PyPy mistakenly declares the first parameter as non-const. |
| 43 | return PyUnicode_DecodeFSDefaultAndSize(const_cast<char *>(w.c_str()), ssize_t(w.size())); |
| 44 | # endif |
| 45 | } |
| 46 | |
| 47 | static PyObject *unicode_from_fs_native(const std::wstring &w) { |
| 48 | return PyUnicode_FromWideChar(w.c_str(), ssize_t(w.size())); |