Skip to content

Commit

Permalink
fix: fix implib file name for python3.13t
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Dec 19, 2024
1 parent 66bdee4 commit e2a1ac7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ impl ImportLibraryGenerator {
///
/// Returns the full import library file path under `out_dir`.
fn implib_file_path(&self, out_dir: &Path, libext: &str) -> PathBuf {
let abiflags = self.abiflags.as_deref().unwrap_or_default();
let libname = match self.version {
Some((major, minor)) => {
format!("python{}{}{}", major, minor, libext)
format!("python{}{}{}{}", major, minor, abiflags, libext)
}
None => format!("python3{}", libext),
};
Expand Down Expand Up @@ -663,11 +664,13 @@ mod tests {

// Free-threaded CPython v3.13+
for minor in 13..=13 {
ImportLibraryGenerator::new("aarch64", "msvc")
.version(Some((3, minor)))
.abiflags(Some("t"))
.generate(&dir)
.unwrap();
let mut generator = ImportLibraryGenerator::new("aarch64", "msvc");
generator.version(Some((3, minor))).abiflags(Some("t"));
let implib_file_path = generator.implib_file_path(&dir, IMPLIB_EXT_MSVC);
let implib_file_stem = implib_file_path.file_stem().unwrap().to_str().unwrap();
assert!(implib_file_stem.ends_with("t"));

generator.generate(&dir).unwrap();
}

// PyPy
Expand Down

0 comments on commit e2a1ac7

Please sign in to comment.