| 229 | } |
| 230 | |
| 231 | Result<std::shared_ptr<Buffer>> PyBuffer::FromPyObject(PyObject* obj) { |
| 232 | PyBuffer* buf = new PyBuffer(); |
| 233 | std::shared_ptr<Buffer> res(buf); |
| 234 | RETURN_NOT_OK(buf->Init(obj)); |
| 235 | return res; |
| 236 | } |
| 237 | |
| 238 | PyBuffer::~PyBuffer() { |
| 239 | // GH-38626: destructor may be called after the Python interpreter is finalized. |