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

Replace str.index with str.find #1130

Merged
merged 1 commit into from
Oct 19, 2024
Merged

Replace str.index with str.find #1130

merged 1 commit into from
Oct 19, 2024

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Sep 22, 2024

str.index raises a ValueError when the substring is not found so there is no way to even check the return value as the code currently tries to do. Replacing it with str.find makes the code work as intended.

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.28%. Comparing base (f91754b) to head (be2709c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1130      +/-   ##
==========================================
+ Coverage   91.26%   91.28%   +0.02%     
==========================================
  Files          27       27              
  Lines        4602     4602              
==========================================
+ Hits         4200     4201       +1     
+ Misses        402      401       -1     
Flag Coverage Δ
macos-12-3.10 90.09% <100.00%> (+0.02%) ⬆️
macos-12-3.11 90.02% <100.00%> (+0.02%) ⬆️
macos-12-3.12 90.19% <100.00%> (+0.02%) ⬆️
macos-12-3.13-dev 89.72% <100.00%> (+0.02%) ⬆️
macos-12-3.8 90.01% <100.00%> (+0.02%) ⬆️
macos-12-3.9 90.01% <100.00%> (+0.02%) ⬆️
macos-12-pypy3.10 90.09% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.10 90.11% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.11 90.04% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.12 90.22% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.13-dev 89.74% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.8 90.04% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.9 90.04% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-pypy3.10 90.11% <100.00%> (+0.02%) ⬆️
windows-2022-3.10 90.23% <100.00%> (+0.02%) ⬆️
windows-2022-3.11 90.16% <100.00%> (+0.02%) ⬆️
windows-2022-3.12 90.34% <100.00%> (+0.02%) ⬆️
windows-2022-3.13-dev 89.86% <100.00%> (+0.02%) ⬆️
windows-2022-3.8 90.16% <100.00%> (+0.02%) ⬆️
windows-2022-3.9 90.16% <100.00%> (+0.02%) ⬆️
windows-2022-pypy3.10 90.23% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@akx akx left a comment

Choose a reason for hiding this comment

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

Good catch!

@akx akx merged commit d4069ee into python-babel:master Oct 19, 2024
26 checks passed
@tomasr8 tomasr8 deleted the index-fix branch October 19, 2024 19:48
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