babel icon indicating copy to clipboard operation
babel copied to clipboard

Replace `str.index` with `str.find`

Open tomasr8 opened this issue 1 year ago • 1 comments

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.

tomasr8 avatar Sep 22 '24 13:09 tomasr8

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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%) :arrow_up:
macos-12-3.11 90.02% <100.00%> (+0.02%) :arrow_up:
macos-12-3.12 90.19% <100.00%> (+0.02%) :arrow_up:
macos-12-3.13-dev 89.72% <100.00%> (+0.02%) :arrow_up:
macos-12-3.8 90.01% <100.00%> (+0.02%) :arrow_up:
macos-12-3.9 90.01% <100.00%> (+0.02%) :arrow_up:
macos-12-pypy3.10 90.09% <100.00%> (+0.02%) :arrow_up:
ubuntu-22.04-3.10 90.11% <100.00%> (+0.02%) :arrow_up:
ubuntu-22.04-3.11 90.04% <100.00%> (+0.02%) :arrow_up:
ubuntu-22.04-3.12 90.22% <100.00%> (+0.02%) :arrow_up:
ubuntu-22.04-3.13-dev 89.74% <100.00%> (+0.02%) :arrow_up:
ubuntu-22.04-3.8 90.04% <100.00%> (+0.02%) :arrow_up:
ubuntu-22.04-3.9 90.04% <100.00%> (+0.02%) :arrow_up:
ubuntu-22.04-pypy3.10 90.11% <100.00%> (+0.02%) :arrow_up:
windows-2022-3.10 90.23% <100.00%> (+0.02%) :arrow_up:
windows-2022-3.11 90.16% <100.00%> (+0.02%) :arrow_up:
windows-2022-3.12 90.34% <100.00%> (+0.02%) :arrow_up:
windows-2022-3.13-dev 89.86% <100.00%> (+0.02%) :arrow_up:
windows-2022-3.8 90.16% <100.00%> (+0.02%) :arrow_up:
windows-2022-3.9 90.16% <100.00%> (+0.02%) :arrow_up:
windows-2022-pypy3.10 90.23% <100.00%> (+0.02%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 22 '24 13:09 codecov[bot]