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

Function warn_deprecated_throw_signature

crates/vm/src/coroutine.rs:336–356  ·  view source on GitHub ↗

Emit DeprecationWarning for the deprecated 3-argument throw() signature.

(
    exc_val: &OptionalArg,
    exc_tb: &OptionalArg,
    vm: &VirtualMachine,
)

Source from the content-addressed store, hash-verified

334
335/// Emit DeprecationWarning for the deprecated 3-argument throw() signature.
336pub fn warn_deprecated_throw_signature(
337 exc_val: &OptionalArg,
338 exc_tb: &OptionalArg,
339 vm: &VirtualMachine,
340) -> PyResult<()> {
341 if exc_val.is_present() || exc_tb.is_present() {
342 crate::warn::warn(
343 vm.ctx
344 .new_str(
345 "the (type, val, tb) signature of throw() is deprecated, \
346 use throw(val) instead",
347 )
348 .into(),
349 Some(vm.ctx.exceptions.deprecation_warning.to_owned()),
350 1,
351 None,
352 vm,
353 )?;
354 }
355 Ok(())
356}

Callers 4

throwMethod · 0.85
throwMethod · 0.85
athrowMethod · 0.85
throwMethod · 0.85

Calls 4

warnFunction · 0.70
SomeClass · 0.50
new_strMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected