Cleanly break out of windows iteration #2189
Closed
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.
Split this out of #2183 (with additional improvements).
Notes:
To be merged after Extend PyWin_SetAPIError #2188 (although after that one is merged this will become invalid as it's on top of it (for testing purposes))!
Applied the same mechanism to all window enumeration functions. For EnumChildWindows, due to its special return value case, an exception will only be raised when callback raises one (when returning False and setting last error, no exception will be raised as in EnumWindows' case). Note that now it will raise the correct exception as until now in some cases it was (wrongly) raising:
SystemError: <built-in function EnumChildWindows> returned a result with an exception set