From 34eabf4757c5d99a094d4c1cda1301ade0db08df Mon Sep 17 00:00:00 2001 From: Gentle Date: Fri, 9 Feb 2024 16:51:19 +0100 Subject: [PATCH] disable AsRawFd on Windows --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ccd47d0..c6a1259 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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)] @@ -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| {