You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like a real alert to me. In the case where not api is false, the second and third except blocks will be unreachable, since all three except block will only catch exceptions of type NeverRaise.
You might argue that it's not a very useful alert, which I guess ends up being a matter of viewpoint/taste.
One way to get around this would be to structure your code as
# if api, we want to raise the exception; otherwise we will perform special handlingexcept (BaseExceptionifapielseNeverRaise):
raiseexceptKeyboardInterruptase:
...
exceptExitCodeExceptionase:
...
exceptExceptionase:
...
Description of the false positive
This is both a valid construct and a compact way to express the fact that under certain conditions, a particular except block should not be processed.
https://lgtm.com/projects/g/jbarlow83/OCRmyPDF/snapshot/c3799e9226e368d3339d8c411484892ba54cbd81/files/src/ocrmypdf/_sync.py?sort=name&dir=ASC&mode=heatmap#x17505d1e5cd98f90:1
The text was updated successfully, but these errors were encountered: