Skip to content

Commit

Permalink
Merge pull request #1488 from rdiankov/usePyUnicode_GET_LENGTH
Browse files Browse the repository at this point in the history
Use PyUnicode_GET_LENGTH
  • Loading branch information
rdiankov authored Jan 31, 2025
2 parents c467dc7 + d2d82f2 commit fe2e36a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/bindings/openravepy_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void toRapidJSONValue(const object &obj, rapidjson::Value &value, rapidjson::Doc
#if PY_MAJOR_VERSION >= 3
else if (PyUnicode_Check(obj.ptr()))
{
value.SetString(PyUnicode_AsUTF8(obj.ptr()), PyUnicode_GET_SIZE(obj.ptr()), allocator);
value.SetString(PyUnicode_AsUTF8(obj.ptr()), PyUnicode_GET_LENGTH(obj.ptr()), allocator);
}
#else
else if (PyString_Check(obj.ptr()))
Expand Down

0 comments on commit fe2e36a

Please sign in to comment.