mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-19 00:04:41 +08:00
fail early if readinto does not exist (#221)
This commit is contained in:
@@ -26,7 +26,7 @@ using namespace mlx::core;
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool is_istream_object(const py::object& file) {
|
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");
|
py::hasattr(file, "tell") && py::hasattr(file, "closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user