Do not run process_handler
when exit_codes=[]
.
#4380
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, a
process_handler
that gets passed an emptyexit_codes
list will always run. I think it would be more consistent to never run these, and always run only whenexit_codes=None
.That's certainly debatable, but since the change is simple enough I decided to make a PR to decide this over instead of making an issue first.
One could also consider emitting a warning when an empty list is passed (since the handler is then essentially dead code) - but if the list of exit codes is "dynamically determined" it could lead to false warnings.
Context: I tried removing
ERROR_COMPUTING_CHOLESKY
from the following, and was surprised that it then always ran:Update: Just noticed that the docstring for the
exit_codes
parameter supports changing the behavior (or otherwise, the docstring would need changing):