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

Fix missing method str.removeprefix in Python 3.8 #695

Merged
merged 6 commits into from
May 24, 2024

Conversation

bartbroere
Copy link
Contributor

Eland still supports Python 3.8, so str.removeprefix can be called and raise an AttributeError.

Once Eland drops Python 3.8 support this if/else can be removed (only keeping the code in the if).

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! I don't think this is worth a condition, I would use the slice and mention this can be replaced by removeprefix when we remove Python 3.8.

@bartbroere
Copy link
Contributor Author

I would use the slice and mention this can be replaced by removeprefix when we remove Python 3.8.

That sounds a bit less verbose indeed. I committed the suggestion.

@bartbroere bartbroere requested a review from pquentin May 21, 2024 20:54
@pquentin
Copy link
Member

buildkite test this please

@pquentin
Copy link
Member

buildkite test this please

@pquentin
Copy link
Member

buildkite test this please

@pquentin pquentin merged commit 35a96ab into elastic:main May 24, 2024
4 checks passed
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