-
-
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
base: trunk
Are you sure you want to change the base?
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 |
User description
🔗 Related Issues
Fixes #16256
💥 What does this PR do?
Replaces instances of
platform.system()
withsys.platform
and 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.platform
across 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 configuration
py/conftest.py
platform.system()
import withsys
importexe_platform
propertyservice.py
Modernize platform detection in service module
py/selenium/webdriver/common/service.py
platform.system
import withsys
importfirefox_binary.py
Update Firefox binary platform detection
py/selenium/webdriver/firefox/firefox_binary.py
platform.system
import withsys
importsys.platform
directlyremote_connection.py
Modernize platform detection in remote connection
py/selenium/webdriver/remote/remote_connection.py
platform
import withsys
importsys.platform
firefox_sizing_tests.py
Update Linux detection in Firefox sizing tests
py/test/selenium/webdriver/firefox/firefox_sizing_tests.py
platform
import withsys
importsys.platform.startswith("linux")
chrome_options_tests.py
Update platform detection in Chrome options tests
py/test/unit/selenium/webdriver/chrome/chrome_options_tests.py
platform
import withsys
import