@@ -614,11 +614,9 @@ impl VirtualMachine {
614
614
615
615
/// Instantiate an exception with arguments.
616
616
/// This function should only be used with builtin exception types; if a user-defined exception
617
- /// type is passed in, it may not be fully initialized; try using [`exceptions::invoke`]
618
- /// or [`exceptions::ExceptionCtor`] instead.
619
- ///
620
- /// [exceptions::invoke]: rustpython_vm::exceptions::invoke
621
- /// [exceptions::ctor]: rustpython_vm::exceptions::ExceptionCtor
617
+ /// type is passed in, it may not be fully initialized; try using
618
+ /// [`vm.invoke_exception()`][Self::invoke_exception] or
619
+ /// [`exceptions::ExceptionCtor`][crate::exceptions::ExceptionCtor] instead.
622
620
pub fn new_exception ( & self , exc_type : PyTypeRef , args : Vec < PyObjectRef > ) -> PyBaseExceptionRef {
623
621
// TODO: add repr of args into logging?
624
622
@@ -634,22 +632,18 @@ impl VirtualMachine {
634
632
635
633
/// Instantiate an exception with no arguments.
636
634
/// This function should only be used with builtin exception types; if a user-defined exception
637
- /// type is passed in, it may not be fully initialized; try using [`exceptions::invoke`]
638
- /// or [`exceptions::ExceptionCtor`] instead.
639
- ///
640
- /// [exceptions::invoke]: rustpython_vm::exceptions::invoke
641
- /// [exceptions::ctor]: rustpython_vm::exceptions::ExceptionCtor
635
+ /// type is passed in, it may not be fully initialized; try using
636
+ /// [`vm.invoke_exception()`][Self::invoke_exception] or
637
+ /// [`exceptions::ExceptionCtor`][crate::exceptions::ExceptionCtor] instead.
642
638
pub fn new_exception_empty ( & self , exc_type : PyTypeRef ) -> PyBaseExceptionRef {
643
639
self . new_exception ( exc_type, vec ! [ ] )
644
640
}
645
641
646
642
/// Instantiate an exception with `msg` as the only argument.
647
643
/// This function should only be used with builtin exception types; if a user-defined exception
648
- /// type is passed in, it may not be fully initialized; try using [`exceptions::invoke`]
649
- /// or [`exceptions::ExceptionCtor`] instead.
650
- ///
651
- /// [exceptions::invoke]: rustpython_vm::exceptions::invoke
652
- /// [exceptions::ctor]: rustpython_vm::exceptions::ExceptionCtor
644
+ /// type is passed in, it may not be fully initialized; try using
645
+ /// [`vm.invoke_exception()`][Self::invoke_exception] or
646
+ /// [`exceptions::ExceptionCtor`][crate::exceptions::ExceptionCtor] instead.
653
647
pub fn new_exception_msg ( & self , exc_type : PyTypeRef , msg : String ) -> PyBaseExceptionRef {
654
648
self . new_exception ( exc_type, vec ! [ self . ctx. new_str( msg) . into( ) ] )
655
649
}
0 commit comments