(message: &'static str, vm: &VirtualMachine)
| 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"") |