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

Function warn

crates/vm/src/stdlib/_warnings.rs:5–18  ·  view source on GitHub ↗
(
    category: &Py<PyType>,
    message: String,
    stack_level: usize,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

3use crate::{Py, PyResult, VirtualMachine, builtins::PyType};
4
5pub fn warn(
6 category: &Py<PyType>,
7 message: String,
8 stack_level: usize,
9 vm: &VirtualMachine,
10) -> PyResult<()> {
11 crate::warn::warn(
12 vm.new_pyobj(message),
13 Some(category.to_owned()),
14 isize::try_from(stack_level).unwrap_or(isize::MAX),
15 None,
16 vm,
17 )
18}
19
20#[pymodule]
21mod _warnings {

Callers 15

breakpointhookFunction · 0.70
io_openFunction · 0.70
text_encodingFunction · 0.70
initMethod · 0.70
dealloc_warnMethod · 0.70
warn_if_multi_threadedFunction · 0.70
warn_if_bool_fdFunction · 0.70
delMethod · 0.70
try_intMethod · 0.50
intMethod · 0.50
indexMethod · 0.50
floatMethod · 0.50

Calls 10

get_categoryFunction · 0.85
warn_with_skipFunction · 0.85
new_pyobjMethod · 0.80
into_optionMethod · 0.80
isMethod · 0.80
SomeClass · 0.50
ErrClass · 0.50
to_ownedMethod · 0.45
iterMethod · 0.45
classMethod · 0.45

Tested by

no test coverage detected