(size: isize, vm: &VirtualMachine)
| 1585 | |
| 1586 | #[pyfunction] |
| 1587 | fn urandom(size: isize, vm: &VirtualMachine) -> PyResult<Vec<u8>> { |
| 1588 | if size < 0 { |
| 1589 | return Err(vm.new_value_error("negative argument not allowed")); |
| 1590 | } |
| 1591 | let mut buf = vec![0u8; size as usize]; |
| 1592 | getrandom::fill(&mut buf).map_err(|e| io::Error::from(e).into_pyexception(vm))?; |
| 1593 | Ok(buf) |
| 1594 | } |
| 1595 | |
| 1596 | #[pyfunction] |
| 1597 | pub fn isatty(fd: i32) -> bool { |
nothing calls this directly
no test coverage detected