From 2a8e97b8ed89d30840a5d9ece1d921165f179a64 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Tue, 26 Nov 2024 15:07:55 -0700 Subject: [PATCH] support interpreter names like '3.13t --- src/build_options.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/build_options.rs b/src/build_options.rs index fd136cbc2..7f1038193 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -1279,8 +1279,17 @@ fn find_interpreter_in_sysconfig( .map(|c| c.is_ascii_digit()) .unwrap_or(false) { - // Eg: -i 3.9 without interpreter kind, assume it's CPython - (InterpreterKind::CPython, &*python, "") + // Eg: -i 3.9 or 3.13t without interpreter kind, assume it's CPython + let (ver, abiflags) = if let Some(ver) = python + .strip_prefix('-') + .unwrap_or(&python) + .strip_suffix('t') + { + (ver, "t") + } else { + (&*python, "") + }; + (InterpreterKind::CPython, ver, abiflags) } else { // if interpreter not known if std::path::Path::new(&python).is_file() {