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

Function warn_with_skip

crates/vm/src/warn.rs:312–331  ·  view source on GitHub ↗

do_warn: resolve context via setup_context, then call warn_explicit.

(
    message: PyObjectRef,
    category: Option<PyTypeRef>,
    mut stack_level: isize,
    source: Option<PyObjectRef>,
    skip_file_prefixes: Option<PyTupleRef>,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

310
311/// do_warn: resolve context via setup_context, then call warn_explicit.
312pub fn warn_with_skip(
313 message: PyObjectRef,
314 category: Option<PyTypeRef>,
315 mut stack_level: isize,
316 source: Option<PyObjectRef>,
317 skip_file_prefixes: Option<PyTupleRef>,
318 vm: &VirtualMachine,
319) -> PyResult<()> {
320 if let Some(ref prefixes) = skip_file_prefixes
321 && !prefixes.is_empty()
322 && stack_level < 2
323 {
324 stack_level = 2;
325 }
326 let (filename, lineno, module, registry) =
327 setup_context(stack_level, skip_file_prefixes.as_ref(), vm)?;
328 warn_explicit(
329 category, message, filename, lineno, module, registry, None, source, vm,
330 )
331}
332
333/// Core warning logic matching `warn_explicit()` in `_warnings.c`.
334#[allow(clippy::too_many_arguments)]

Callers 2

warnFunction · 0.85
warnFunction · 0.85

Calls 4

setup_contextFunction · 0.85
warn_explicitFunction · 0.70
is_emptyMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected