Skip to content
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

Evaluate_pyupgrade_ruleset #694

Merged
merged 13 commits into from
Sep 18, 2024
Merged

Conversation

helylle
Copy link
Contributor

@helylle helylle commented Sep 16, 2024

Fix issues from pyupgrade ruleset targetting python 3.10 as it is our current running environment.
Majority is PEP604 union operator | replacing Union[]

Some typing imports are unnecessary with our current python version.
Specifically use builtins.type for those classes that have a variable named type
Use the updated | operator for union types in python 3.10 and later PEP604
update isinstance calls to use updated | operator for union types PEP604
since python 3.3 IOError and a few others have been merged into OSError and is only an alias
Base automatically changed from further_linting to main September 17, 2024 07:54
Copy link

except IOError:
response = "File not found".encode()
except OSError:
response = b"File not found"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linting said .encode() was unnecessary for ut-8 encoding but it was there to make it a bytes string literal which can be done with b-strings

@helylle helylle marked this pull request as ready for review September 17, 2024 08:12
@johanlundberg johanlundberg merged commit 6d90890 into main Sep 18, 2024
11 checks passed
@johanlundberg johanlundberg deleted the ylle_evaluate_pyupgrade_ruleset branch September 18, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants