fail early if readinto does not exist

This commit is contained in:
dc-dc-dc
2023-12-19 14:24:03 -05:00
parent dfa9f4bc58
commit 001efffde0

View File

@@ -26,7 +26,7 @@ using namespace mlx::core;
///////////////////////////////////////////////////////////////////////////////
bool is_istream_object(const py::object& file) {
return py::hasattr(file, "read") && py::hasattr(file, "seek") &&
return py::hasattr(file, "readinto") && py::hasattr(file, "seek") &&
py::hasattr(file, "tell") && py::hasattr(file, "closed");
}