MCPcopy Index your code
hub / github.com/RustPython/RustPython / flush_io

Method flush_io

crates/vm/src/vm/mod.rs:1234–1241  ·  view source on GitHub ↗

flush_io Flush stdout and stderr. Errors are silently ignored.

(&self)

Source from the content-addressed store, hash-verified

1232 ///
1233 /// Flush stdout and stderr. Errors are silently ignored.
1234 fn flush_io(&self) {
1235 if let Ok(stdout) = self.sys_module.get_attr("stdout", self) {
1236 let _ = self.call_method(&stdout, identifier!(self, flush).as_str(), ());
1237 }
1238 if let Ok(stderr) = self.sys_module.get_attr("stderr", self) {
1239 let _ = self.call_method(&stderr, identifier!(self, flush).as_str(), ());
1240 }
1241 }
1242
1243 /// Clear module references during shutdown.
1244 /// Follows the same phased algorithm as pylifecycle.c finalize_modules():

Callers 1

with_simple_runMethod · 0.80

Calls 3

get_attrMethod · 0.45
call_methodMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected