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 19, 2019
1 parent f6352ea commit 7031f2f
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 7031f2f

Please sign in to comment.