From 137f55bf289dda0a5e52502a427ea1705a074ca2 Mon Sep 17 00:00:00 2001 From: Diogo Date: Tue, 19 Dec 2023 16:27:17 -0500 Subject: [PATCH] fail early if readinto does not exist (#221) --- python/src/load.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/load.cpp b/python/src/load.cpp index d3c603008..0730d33d6 100644 --- a/python/src/load.cpp +++ b/python/src/load.cpp @@ -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"); }