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

Method modify

crates/stdlib/src/select.rs:467–479  ·  view source on GitHub ↗
(
                &self,
                Fildes(fd): Fildes,
                eventmask: EventMask,
                vm: &VirtualMachine,
            )

Source from the content-addressed store, hash-verified

465
466 #[pymethod]
467 fn modify(
468 &self,
469 Fildes(fd): Fildes,
470 eventmask: EventMask,
471 vm: &VirtualMachine,
472 ) -> PyResult<()> {
473 let mut fds = self.fds.lock();
474 // CPython raises KeyError if fd is not registered, match that behavior
475 let pfd = get_fd_mut(&mut fds, fd)
476 .ok_or_else(|| vm.new_key_error(vm.ctx.new_int(fd).into()))?;
477 pfd.events = eventmask.0;
478 Ok(())
479 }
480
481 #[pymethod]
482 fn unregister(&self, Fildes(fd): Fildes, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 8

get_fd_mutFunction · 0.85
ok_or_elseMethod · 0.80
new_key_errorMethod · 0.80
get_epollMethod · 0.80
lockMethod · 0.45
new_intMethod · 0.45
as_raw_fdMethod · 0.45
into_pyexceptionMethod · 0.45

Tested by

no test coverage detected