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,
)
| 310 | |
| 311 | /// do_warn: resolve context via setup_context, then call warn_explicit. |
| 312 | pub 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)] |
no test coverage detected