Skip to content

Commit

Permalink
Merge pull request #7052 from anntzer/catch-exceptions-in-qt5-draw-pr…
Browse files Browse the repository at this point in the history
…events-abort

FIX: Uncaught exns are fatal for PyQt5, so catch them.
  • Loading branch information
tacaswell committed Sep 7, 2016
1 parent 73a23f7 commit c5cdc1a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/matplotlib/backends/backend_qt5agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

import six

import sys
import ctypes
import sys
import traceback

from matplotlib.figure import Figure

Expand Down Expand Up @@ -181,6 +182,9 @@ def __draw_idle_agg(self, *args):
try:
FigureCanvasAgg.draw(self)
self.update()
except Exception:
# Uncaught exceptions are fatal for PyQt5, so catch them instead.
traceback.print_exc()
finally:
self._agg_draw_pending = False

Expand Down

0 comments on commit c5cdc1a

Please sign in to comment.