From 2833cd8896063f7d7cf2372557fd30772bc12332 Mon Sep 17 00:00:00 2001 From: Jiseok CHOI Date: Sun, 1 Mar 2026 00:55:12 +0900 Subject: [PATCH] add isatty() method in BytesIO (#7243) --- crates/vm/src/stdlib/io.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/vm/src/stdlib/io.rs b/crates/vm/src/stdlib/io.rs index fb3d8cadf..26d4a67c8 100644 --- a/crates/vm/src/stdlib/io.rs +++ b/crates/vm/src/stdlib/io.rs @@ -4768,6 +4768,15 @@ mod _io { Ok(()) } + + #[pymethod] + fn isatty(&self, vm: &VirtualMachine) -> PyResult { + if self.closed() { + return Err(io_closed_error(vm)); + } + + Ok(false) + } } #[pyclass]