Skip to content

Commit

Permalink
Fix panic when parsing ABI tag on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Anderson committed Nov 16, 2021
1 parent 52301f0 commit 7ab810a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pyo3-build-config/src/impl_.rs
Expand Up @@ -236,11 +236,7 @@ print("mingw", get_platform().startswith("mingw"))
let abi3 = is_abi3();
let abi_flags = map["abiflags"].to_string();
let soabi = map["soabi"].as_str();
let abi_tag = soabi
.split('-')
.nth(1)
.map(ToString::to_string)
.expect("unable to parse ABI tag from SOABI");
let abi_tag = soabi.split('-').nth(1).map(ToString::to_string);
let ext_suffix = map["ext_suffix"].to_string();

let implementation = map["implementation"].parse()?;
Expand Down Expand Up @@ -282,7 +278,7 @@ print("mingw", get_platform().startswith("mingw"))
shared,
abi3,
abi_flags: Some(abi_flags),
abi_tag: Some(abi_tag),
abi_tag,
ext_suffix: Some(ext_suffix),
lib_name: Some(lib_name),
lib_dir,
Expand Down

0 comments on commit 7ab810a

Please sign in to comment.