Comment 3 for bug 916827

Revision history for this message
Ionuț Arțăriși (mapleoin) wrote :

Shouldn't this method return false instead of re-raising the error? As per: http://docs.python.org/library/stdtypes.html?highlight=__exit__#contextmanager.__exit__

The exception passed in should never be reraised explicitly - instead, this method should return a false value to indicate that the method completed successfully and does not want to suppress the raised exception. This allows context management code (such as contextlib.nested) to easily detect whether or not an __exit__() method has actually failed.