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

Method new_exception_msg

crates/vm/src/vm/vm_new.rs:154–156  ·  view source on GitHub ↗

Instantiate an exception with `msg` as the only argument. 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, msg: Wtf8Buf)

Source from the content-addressed store, hash-verified

152 /// [`vm.invoke_exception()`][Self::invoke_exception] or
153 /// [`exceptions::ExceptionCtor`][crate::exceptions::ExceptionCtor] instead.
154 pub fn new_exception_msg(&self, exc_type: PyTypeRef, msg: Wtf8Buf) -> PyBaseExceptionRef {
155 self.new_exception(exc_type, vec![self.ctx.new_str(msg).into()])
156 }
157
158 /// Instantiate an exception with `msg` as the only argument and `dict` for object
159 /// This function should only be used with builtin exception types; if a user-defined exception

Callers 15

run_shellFunction · 0.80
install_pipFunction · 0.80
js_err_to_py_errFunction · 0.80
setlocaleFunction · 0.80
new_binascii_errorFunction · 0.80
releaseMethod · 0.80
fromfileMethod · 0.80
new_lzma_errorFunction · 0.80
new_csv_errorFunction · 0.80
resolve_digestmodFunction · 0.80
unsupported_hashFunction · 0.80
new_zlib_errorFunction · 0.80

Calls 1

new_exceptionMethod · 0.80

Tested by

no test coverage detected