mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
fix bug in numbuf serialization (#296)
This commit is contained in:
parent
a0dd3a44c0
commit
9973a6e37c
1 changed files with 2 additions and 1 deletions
|
@ -98,13 +98,14 @@ Status append(PyObject* elem, SequenceBuilder& builder, std::vector<PyObject*>&
|
|||
Py_ssize_t size;
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
char* data = PyUnicode_AsUTF8AndSize(elem, &size);
|
||||
Status s = builder.AppendString(data, size);
|
||||
#else
|
||||
PyObject* str = PyUnicode_AsUTF8String(elem);
|
||||
char* data = PyString_AS_STRING(str);
|
||||
size = PyString_GET_SIZE(str);
|
||||
Status s = builder.AppendString(data, size);
|
||||
Py_XDECREF(str);
|
||||
#endif
|
||||
Status s = builder.AppendString(data, size);
|
||||
RETURN_NOT_OK(s);
|
||||
} else if (PyList_Check(elem)) {
|
||||
builder.AppendList(PyList_Size(elem));
|
||||
|
|
Loading…
Add table
Reference in a new issue