From 36c26525f2d9638648d63c88c4d101bf59b12ace Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 2 May 2018 21:56:45 +0100 Subject: [PATCH 1/2] Make removing callbacks more robust to _callbacks changing --- CHANGES.md | 3 +++ glue/core/state.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 058f1ed86..b468b4807 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,9 @@ v0.14.0 (unreleased) v0.13.2 (unreleased) -------------------- +* Fixed a bug related to callback functions when restoring sessions. + [#1695] + * Fixed a bug that caused the EditSubsetMode toolbar to not change when EditSubsetMode.mode was changed programatically. [#1684] diff --git a/glue/core/state.py b/glue/core/state.py index b81257984..a79f1789a 100644 --- a/glue/core/state.py +++ b/glue/core/state.py @@ -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 From f47dbc1323ec9dbf4cf1e2d25e829cef51f6e059 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 3 May 2018 13:53:27 +0100 Subject: [PATCH 2/2] Moved changelog entry [ci skip] --- CHANGES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b468b4807..eb7f0647f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,12 +6,15 @@ 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 when EditSubsetMode.mode was changed programatically. [#1684]