Emit DeprecationWarning for the deprecated 3-argument throw() signature.
(
exc_val: &OptionalArg,
exc_tb: &OptionalArg,
vm: &VirtualMachine,
)
| 334 | |
| 335 | /// Emit DeprecationWarning for the deprecated 3-argument throw() signature. |
| 336 | pub 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 | } |