From dafaf1d88951482a3221163d0813541857e88711 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Tue, 21 Sep 2021 17:17:45 +0200 Subject: [PATCH] Fix for matplotlib's master branch --- ipympl/backend_nbagg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipympl/backend_nbagg.py b/ipympl/backend_nbagg.py index 1c955cb2..aa1882d8 100644 --- a/ipympl/backend_nbagg.py +++ b/ipympl/backend_nbagg.py @@ -181,7 +181,10 @@ def _handle_message(self, object, content, buffers): def send_json(self, content): # Change in the widget state? if content['type'] == 'cursor': - self._cursor = cursors_str[content['cursor']] + cursor = content['cursor'] + self._cursor = ( + cursors_str[cursor] if cursor in cursors_str else cursor + ) elif content['type'] == 'message': self._message = content['message']