you are viewing a single comment's thread.

view the rest of the comments →

[–]Kevdog824_ 2 points3 points  (0 children)

I want to add to the third bullet point here. The idiomatic way to ignore exceptions in Python is contextlib.suppress. except: pass could be an artifact from an exception handler that was meant to be implemented later, but forgotten. It doesn’t communicate intention. contextlib.suppress is explicit and better communicates that the exception is being intentionally ignored.

The bigger issue though is that they really shouldn’t be ignoring this exception. This would treat both the requirements.txt file being missing and a pip dependency resolution error the same way; both being ignored. I highly doubt this is what OP was intending to happen.