-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py]: replace platform.system() with sys.platform
#16259
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
|
According to the docs: https://docs.python.org/3/library/sys.html#sys.platform Also, Cygwin is an annoying corner case (does anyone even use Cygwin anymore?). |
Sure, I will update it.
I would say a lot of people still use it, so its good to support it. |
|
Looks like current code should work well for cygwin since |
We can only do so much for OS outside the big 3 |
|
I just installed cygwin to test this. It supports |
|
Thanks a lot @cgoldberg for verifying. |
User description
🔗 Related Issues
Fixes #16256
💥 What does this PR do?
Replaces instances of
platform.system()withsys.platformand appropriate conversions.🔧 Implementation Notes
💡 Additional Considerations
How well will it work on other OSes except the top 3 (Linux, MacOS, Windows)?
🔄 Types of changes
PR Type
Bug fix
Description
Replace
platform.system()withsys.platformacross Python codebaseAdd proper platform detection logic for Windows, Darwin, and Linux
Remove type ignore comments for Windows-specific subprocess attributes
Update test utilities to use consistent platform detection
Diagram Walkthrough
File Walkthrough
conftest.py
Update platform detection in test configurationpy/conftest.py
platform.system()import withsysimportexe_platformpropertyservice.py
Modernize platform detection in service modulepy/selenium/webdriver/common/service.py
platform.systemimport withsysimportfirefox_binary.py
Update Firefox binary platform detectionpy/selenium/webdriver/firefox/firefox_binary.py
platform.systemimport withsysimportsys.platformdirectlyremote_connection.py
Modernize platform detection in remote connectionpy/selenium/webdriver/remote/remote_connection.py
platformimport withsysimportsys.platformfirefox_sizing_tests.py
Update Linux detection in Firefox sizing testspy/test/selenium/webdriver/firefox/firefox_sizing_tests.py
platformimport withsysimportsys.platform.startswith("linux")chrome_options_tests.py
Update platform detection in Chrome options testspy/test/unit/selenium/webdriver/chrome/chrome_options_tests.py
platformimport withsysimport