Skip to content

Commit

Permalink
Merge pull request #19 from Gentle/fix-windowsbuild
Browse files Browse the repository at this point in the history
disable AsRawFd on Windows
  • Loading branch information
omerbenamram authored Feb 11, 2024
2 parents d2085e4 + 34eabf4 commit b6638e8
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 b6638e8

Please sign in to comment.