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

Make removing callbacks more robust to _callbacks changing #1695

Merged
merged 2 commits into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ v0.14.0 (unreleased)

* No changes yet.

v0.13.2 (unreleased)
v0.13.3 (unreleased)
--------------------

* Fixed a bug related to callback functions when restoring sessions.
[#1695]

v0.13.2 (2018-05-01)
--------------------

* Fixed a bug that caused the EditSubsetMode toolbar to not change
Expand Down
8 changes: 7 additions & 1 deletion glue/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,13 @@ def _try_callbacks(self):
except Exception:
pass
else:
self._callbacks.remove(callback)
# In some cases (unclear how to trigger this) callback is no
# longer in the list by the time we try and remove it, hence
# why we need this try...except.
try:
self._callbacks.remove(callback)
except ValueError:
pass


saver = GlueSerializer.serializes
Expand Down