klen / pylama

Code audit tool for python.
MIT License
1.05k stars 99 forks source link

`RunContext` swallows unexpected exceptions silently #207

Closed ilyalabun closed 2 years ago

ilyalabun commented 2 years ago

If Context Manager's method __exit__ returns a true value exception thrown in with block is not propagated. Currently RunContext.__exit__ return self which is always a true value because it can never be None.

This change fixes __exit__ method to return True only if exception is expected (i.e. handled by pushing error message into the context). In other cases exception will always be propagated.