Skip to content

Commit

Permalink
disable AsRawFd on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Gentle committed Feb 9, 2024
1 parent d2085e4 commit 34eabf4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pyo3::types::{PyBytes, PyString, PyType};

use std::io;
use std::io::{Read, Seek, SeekFrom, Write};
#[cfg(not(target_os = "windows"))]
use std::os::fd::{AsRawFd, RawFd};

#[derive(Debug)]
Expand Down Expand Up @@ -188,6 +189,7 @@ impl Seek for PyFileLikeObject {
}
}

#[cfg(not(target_os = "windows"))]
impl AsRawFd for PyFileLikeObject {
fn as_raw_fd(&self) -> RawFd {
Python::with_gil(|py| {
Expand Down

0 comments on commit 34eabf4

Please sign in to comment.