mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-23 10:02:12 +08:00
fail early if readinto does not exist (#221)
This commit is contained in:
parent
e549f84532
commit
137f55bf28
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user