]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/python/src/converter/builtin_converters.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / python / src / converter / builtin_converters.cpp
index 1c28af7fc9cc67a5e4a0ed50ce884dc03123b03c..ee2d5b4794bb12d51c0e79d3179dbc76556e2ed9 100644 (file)
@@ -45,11 +45,16 @@ namespace
   {
       return PyString_Check(obj) ? PyString_AsString(obj) : 0;
   }
-#else
+#elif PY_VERSION_HEX < 0x03070000
   void* convert_to_cstring(PyObject* obj)
   {
       return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
   }
+#else
+  void* convert_to_cstring(PyObject* obj)
+  {
+      return PyUnicode_Check(obj) ? const_cast<void*>(reinterpret_cast<const void*>(_PyUnicode_AsString(obj))) : 0;
+  }
 #endif
 
   // Given a target type and a SlotPolicy describing how to perform a