mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-19 09:25:51 +00:00
parent
4567f1f82a
commit
731a9f6cea
@ -1155,8 +1155,10 @@ public:
|
||||
int flags = PyBUF_STRIDES | PyBUF_FORMAT;
|
||||
if (writable) flags |= PyBUF_WRITABLE;
|
||||
Py_buffer *view = new Py_buffer();
|
||||
if (PyObject_GetBuffer(m_ptr, view, flags) != 0)
|
||||
if (PyObject_GetBuffer(m_ptr, view, flags) != 0) {
|
||||
delete view;
|
||||
throw error_already_set();
|
||||
}
|
||||
return buffer_info(view);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user