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