Skip to content

Commit

Permalink
Change sys.platform to platform.system for more stable values
Browse files Browse the repository at this point in the history
  • Loading branch information
kxepal committed Aug 14, 2019
1 parent af557c2 commit 1d367ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/get_interpreter_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"u": sysconfig.get_config_var("Py_UNICODE_SIZE") == 4,
"d": sysconfig.get_config_var("Py_DEBUG") == 1,
# This one isn't technically necessary, but still very useful for sanity checks
"platform": sys.platform,
"platform": platform.system().lower(),
}

print(json.dumps(metadata))
6 changes: 3 additions & 3 deletions src/python_interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ fn fun_with_abiflags(
target: &Target,
) -> Result<String, Error> {
let sane_platform = match message.platform.as_ref() {
"win32" | "win_amd64" => target.is_windows(),
"linux" | "linux2" | "linux3" => target.is_linux(),
"windows" => target.is_windows(),
"linux" => target.is_linux(),
"darwin" => target.is_macos(),
"freebsd11" | "freebsd12" | "freebsd13" => target.is_freebsd(),
"freebsd" => target.is_freebsd(),
_ => false,
};

Expand Down

0 comments on commit 1d367ac

Please sign in to comment.