Skip to content

Commit c6a66be

Browse files
authored
Merge pull request RustPython#3716 from youknowone/to-pyexc
PyResult<T, E> instead of PyResult<T>
2 parents 6343332 + f15c51b commit c6a66be

File tree

4 files changed

+152
-150
lines changed

4 files changed

+152
-150
lines changed

stdlib/src/select.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,10 @@ mod decl {
318318
}
319319

320320
#[pymethod]
321-
fn modify(
322-
&self,
323-
Fildes(fd): Fildes,
324-
eventmask: u16,
325-
vm: &VirtualMachine,
326-
) -> PyResult<()> {
321+
fn modify(&self, Fildes(fd): Fildes, eventmask: u16) -> io::Result<()> {
327322
let mut fds = self.fds.lock();
328323
let pfd = get_fd_mut(&mut fds, fd)
329-
.ok_or_else(|| io::Error::from_raw_os_error(libc::ENOENT).to_pyexception(vm))?;
324+
.ok_or_else(|| io::Error::from_raw_os_error(libc::ENOENT))?;
330325
pfd.events = eventmask as i16;
331326
Ok(())
332327
}

0 commit comments

Comments
 (0)