Don't raise exception when close method of an already-closed dock is called#2089
Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom Nov 14, 2021
Merged
Don't raise exception when close method of an already-closed dock is called#2089j9ac9k merged 2 commits intopyqtgraph:masterfrom
j9ac9k merged 2 commits intopyqtgraph:masterfrom
Conversation
j9ac9k
reviewed
Nov 14, 2021
pyqtgraph/dockarea/Dock.py
Outdated
| def close(self): | ||
| """Remove this dock from the DockArea it lives inside.""" | ||
| if self._container is None: | ||
| warnings.warn(f"Cannot close dock {self} because it is not open.") |
Member
There was a problem hiding this comment.
nice touch on the warning! I think you need to add stacklevel=2 to capture the correct context
warnings.warn(f"Cannot close dock {self} because it is not open.", RuntimeWarning, stacklevel=2)
Member
|
Thanks @max-radin merging! |
ntjess
pushed a commit
to ntjess/pyqtgraph
that referenced
this pull request
Dec 10, 2021
…called (pyqtgraph#2089) * Don't raise exception if user tries to close a dock that's not open * Adding stacklevel to warning on dock close
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See #1702