selenium
selenium copied to clipboard
really drop python<=3.7 support
User description
Description
Filter all python code over pupgrade --py38-plus
.
Motivation and Context
Make code cleaner.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I have read the contributing document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
PR Type
enhancement
Description
- Updated Python code to enhance compatibility with Python 3.8+ by removing outdated syntax and improving string formatting.
- Removed specific mode arguments in file open functions to use default reading mode, simplifying the code.
- Transitioned to using
format
method for string formatting across various scripts and modules.
Changes walkthrough 📝
Relevant files | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Enhancement |
|
💡 PR-Agent usage: Comment
/help
on the PR to get a list of all available PR-Agent tools and their descriptions
PR Description updated to latest commit (https://github.com/SeleniumHQ/selenium/commit/363512f585e4f8da63eaf662f033693b8b353817)
- [ ] Copy walkthrough table to "Files Changed" Tab
PR Review 🔍
⏱️ Estimated effort to review [1-5] |
2, because the changes are mostly syntax updates and string formatting improvements, which are straightforward to review. The PR is well-documented and the changes are consistent across multiple files. |
🧪 Relevant tests |
Yes |
⚡ Possible issues |
Possible Bug: The removal of the file mode "r" in open() calls might not be an issue since it's the default, but it should be confirmed that no binary files are being read, as this could cause unexpected behavior. |
🔒 Security concerns |
No |
PR Code Suggestions ✨
Category | Suggestion | Score |
Best practice |
Use a context manager for file operations to ensure proper resource managementUse a context manager to handle file opening and closing to ensure that the file is common/devtools/convert_protocol_to_json.py [24-27]
Suggestion importance[1-10]: 8Why: This is a valid improvement suggestion as using a context manager for file operations ensures that the file is properly closed even if an error occurs, which is not currently handled in the PR code. | 8 |
Enhancement |
Use f-strings for clearer and more efficient string formattingReplace the string concatenation in the javascript/private/gen_file.py [50]
Suggestion importance[1-10]: 6Why: The suggestion to use f-strings enhances readability and performance, aligning with modern Python practices. This is a good suggestion, but not critical. | 6 |
Signed
@kloczek this is not passing our lint tests, can you please update it?