Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Safe app window close #258

Merged
merged 15 commits into from
Jan 5, 2023
Merged

BUG: Safe app window close #258

merged 15 commits into from
Jan 5, 2023

Conversation

larsoner
Copy link
Contributor

@larsoner larsoner commented Jan 3, 2023

Follow-up to #127 which should help with this:

E   pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function BackgroundPlotter.__del__ at 0x7f869d7a9ab0>
E   
E   Traceback (most recent call last):
E     File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pyvistaqt/plotting.py", line 741, in __del__
E       self.app_window.close()
E   RuntimeError: wrapped C/C++ object of type _MNEMainWindow has been deleted

Makes the code more DRY at the same time rather than duplicating the logic, as self.close() is already just:

        if not self._closed:
            # Can get:
            #
            #     RuntimeError: wrapped C/C++ object of type MainWindow has
            #     been deleted
            #
            # So let's be safe and try/except this in case of a problem.
            try:
                self.app_window.close()
            except Exception:  # pragma: no cover # pylint: disable=broad-except
                pass

@codecov
Copy link

codecov bot commented Jan 3, 2023

Codecov Report

Merging #258 (bd75225) into main (9df3c4b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #258   +/-   ##
=======================================
  Coverage   97.22%   97.22%           
=======================================
  Files           8        8           
  Lines         648      648           
  Branches       90       81    -9     
=======================================
  Hits          630      630           
  Partials       18       18           

@larsoner
Copy link
Contributor Author

larsoner commented Jan 5, 2023

This is a pretty straightforward fix and includes some CI fixes that should hopefully allow us to merge some of the dependabot PRs, so I'll mark this for merge-when-green

@larsoner larsoner merged commit a792bec into pyvista:main Jan 5, 2023
@larsoner larsoner deleted the close branch January 5, 2023 21:26
larsoner added a commit that referenced this pull request Jan 5, 2023
…t-hooks

* upstream/main:
  BUG: Safe app window close (#258)
@larsoner larsoner mentioned this pull request Jan 5, 2023
larsoner added a commit to larsoner/pyvistaqt that referenced this pull request Jan 6, 2023
* upstream/main: (125 commits)
  Bump check-jsonschema from 0.17.1 to 0.20.0 (pyvista#261)
  Bump pre-commit from 2.20.0 to 2.21.0 (pyvista#263)
  Bump matplotlib from 3.5.2 to 3.6.2 (pyvista#262)
  Bump isort from 5.10.1 to 5.11.4 (pyvista#264)
  Bump pre-commit-hooks from 4.3.0 to 4.4.0 (pyvista#260)
  Bump flake8 from 4.0.1 to 6.0.0 (pyvista#251)
  Bump actions/checkout from 2 to 3 in /.github/workflows (pyvista#246)
  Bump pylint from 2.13.0 to 2.15.9 (pyvista#256)
  Bump peter-evans/create-pull-request from 3 to 4 in /.github/workflows (pyvista#249)
  Bump codecov/codecov-action from 2 to 3 in /.github/workflows (pyvista#247)
  Bump actions/setup-python from 2 to 4 in /.github/workflows (pyvista#248)
  Bump numpy from 1.21.6 to 1.24.1 (pyvista#257)
  Bump ipython from 7.34.0 to 8.8.0 (pyvista#259)
  Update pre-commit hooks (pyvista#231)
  BUG: Safe app window close (pyvista#258)
  update pre-commit hooks (pyvista#228)
  Bump pyvista from 0.35.2 to 0.36.0 (pyvista#217)
  Bump imageio from 2.20.0 to 2.21.0 (pyvista#216)
  Bump sphinx from 5.0.2 to 5.1.1 (pyvista#213)
  Bump imageio from 2.19.5 to 2.20.0 (pyvista#214)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant