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

Method new_exception_empty

crates/vm/src/vm/vm_new.rs:145–147  ·  view source on GitHub ↗

Instantiate an exception with no arguments. This function should only be used with builtin exception types; if a user-defined exception type is passed in, it may not be fully initialized; try using [`vm.invoke_exception()`][Self::invoke_exception] or [`exceptions::ExceptionCtor`][crate::exceptions::ExceptionCtor] instead.

(&self, exc_type: PyTypeRef)

Source from the content-addressed store, hash-verified

143 /// [`vm.invoke_exception()`][Self::invoke_exception] or
144 /// [`exceptions::ExceptionCtor`][crate::exceptions::ExceptionCtor] instead.
145 pub fn new_exception_empty(&self, exc_type: PyTypeRef) -> PyBaseExceptionRef {
146 self.new_exception(exc_type, vec![])
147 }
148
149 /// Instantiate an exception with `msg` as the only argument.
150 /// This function should only be used with builtin exception types; if a user-defined exception

Callers 5

run_shellFunction · 0.80
try_from_pyintMethod · 0.80
inputFunction · 0.80
default_int_handlerFunction · 0.80
exitFunction · 0.80

Calls 1

new_exceptionMethod · 0.80

Tested by

no test coverage detected