-
Notifications
You must be signed in to change notification settings - Fork 1.3k
sys.platform
android & ios
#5921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,11 +67,14 @@ mod sys { | |
#[pyattr(name = "platform")] | ||
pub(crate) const PLATFORM: &str = { | ||
cfg_if::cfg_if! { | ||
if #[cfg(any(target_os = "linux", target_os = "android"))] { | ||
// Android is linux as well. see https://bugs.python.org/issue32637 | ||
if #[cfg(target_os = "linux")] { | ||
"linux" | ||
} else if #[cfg(target_os = "android")] { | ||
"android" | ||
} else if #[cfg(target_os = "macos")] { | ||
"darwin" | ||
} else if #[cfg(target_os = "ios")] { | ||
"ios" | ||
Comment on lines
+72
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change correctly implements the For example, you could add checks similar to existing ones for other platforms in # In Lib/test/test_sys.py
elif sys.platform == "android":
# assertions for android
elif sys.platform == "ios":
# assertions for ios Adding tests would improve the robustness of this change. |
||
} else if #[cfg(windows)] { | ||
"win32" | ||
} else if #[cfg(target_os = "wasi")] { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, unlike this link, it is finally changed!