Skip to content

Commit

Permalink
support interpreter names like '3.13t
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Nov 26, 2024
1 parent 3316093 commit 2a8e97b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2a8e97b

Please sign in to comment.