Skip to content

Commit

Permalink
Add default value for abi_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed May 5, 2022
1 parent b5bd113 commit ebe8267
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/python_interpreter/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ impl InterpreterConfig {
let implementation = implementation.unwrap_or_else(|| "cpython".to_string());
let interpreter_kind = implementation.parse().map_err(|e| format_err!("{}", e))?;
let ext_suffix = ext_suffix.context("missing value for ext_suffix")?;
let abi_tag = match interpreter_kind {
InterpreterKind::CPython => {
if (major, minor) >= (3, 8) {
abi_tag.or_else(|| Some(format!("{}{}", major, minor)))
} else {
abi_tag.or_else(|| Some(format!("{}{}m", major, minor)))
}
}
InterpreterKind::PyPy => abi_tag.or_else(|| Some("pp73".to_string())),
};
Ok(Self {
major,
minor,
Expand Down

0 comments on commit ebe8267

Please sign in to comment.