matplotlib/matplotlib — pull request #1098 by efiring (2012-08-17 07:55:08+00:00)
Title: suppress exception upon quitting with qt4agg on osx

Quitting a session of "ipython --pylab=qt" on osx 10.7, with open plot windows, triggers AttributeError; apparently the shutdown process has deleted the FigureCanvas "callbacks" attribute before the close event has had time to run the callbacks. This does not happen on linux. As far as I can tell, the simple solution proposed here, trapping the AttributeError along with the TypeError that was already being trapped, is harmless, and solves this minor annoyance on OSX.