fail early if readinto does not exist (#221)

This commit is contained in:
Diogo
2023-12-19 16:27:17 -05:00
committed by GitHub
parent e549f84532
commit 137f55bf28

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");
}