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 8, 2016
1 parent 45243eb commit 81d5a24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/matplotlib/backends/backend_qt5agg.py
Expand Up @@ -6,8 +6,9 @@

from matplotlib.externals import six

import sys
import ctypes
import sys
import traceback

from matplotlib.figure import Figure

Expand Down Expand Up @@ -178,6 +179,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 81d5a24

Please sign in to comment.