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

Method warn_on_str

crates/vm/src/bytes_inner.rs:240–250  ·  view source on GitHub ↗
(message: &'static str, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

238 }
239
240 pub(crate) fn warn_on_str(message: &'static str, vm: &VirtualMachine) -> PyResult<()> {
241 if vm.state.config.settings.bytes_warning > 0 {
242 crate::stdlib::_warnings::warn(
243 vm.ctx.exceptions.bytes_warning,
244 message.to_owned(),
245 1,
246 vm,
247 )?;
248 }
249 Ok(())
250 }
251
252 pub fn repr_with_name(&self, class_name: &str, vm: &VirtualMachine) -> PyResult<String> {
253 const DECORATION_LEN: isize = 2 + 3; // 2 for (), 3 for b"" => bytearray(b"")

Callers

nothing calls this directly

Calls 2

warnFunction · 0.70
to_ownedMethod · 0.45

Tested by

no test coverage detected