From 7031f2fdf1b475bb87ee68ed5df4e7cb71b53484 Mon Sep 17 00:00:00 2001 From: Alexander Shorin Date: Sat, 3 Aug 2019 18:41:06 +0300 Subject: [PATCH] Change `sys.platform` to `platform.system` for more stable values --- src/get_interpreter_metadata.py | 2 +- src/python_interpreter.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/get_interpreter_metadata.py b/src/get_interpreter_metadata.py index 99afbe5a2..ef7fb9ec8 100644 --- a/src/get_interpreter_metadata.py +++ b/src/get_interpreter_metadata.py @@ -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)) diff --git a/src/python_interpreter.rs b/src/python_interpreter.rs index 793c2455d..53b3cb481 100644 --- a/src/python_interpreter.rs +++ b/src/python_interpreter.rs @@ -305,10 +305,10 @@ fn fun_with_abiflags( target: &Target, ) -> Result { 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, };