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

Function show_warning

crates/vm/src/warn.rs:496–514  ·  view source on GitHub ↗
(
    filename: PyStrRef,
    lineno: usize,
    text: PyStrRef,
    category: PyTypeRef,
    _source_line: Option<PyObjectRef>,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

494}
495
496fn show_warning(
497 filename: PyStrRef,
498 lineno: usize,
499 text: PyStrRef,
500 category: PyTypeRef,
501 _source_line: Option<PyObjectRef>,
502 vm: &VirtualMachine,
503) -> PyResult<()> {
504 let stderr = crate::stdlib::sys::PyStderr(vm);
505 writeln!(
506 stderr,
507 "{}:{}: {}: {}",
508 filename,
509 lineno,
510 category.name(),
511 text
512 );
513 Ok(())
514}
515
516/// Check if a frame's filename starts with any of the given prefixes.
517fn is_filename_to_skip(frame: &crate::frame::Frame, prefixes: &PyTupleRef) -> bool {

Callers 1

call_show_warningFunction · 0.85

Calls 1

PyStderrClass · 0.85

Tested by

no test coverage detected