Prevent ReferenceErrors on cleanup

Prevents a ReferenceError being thrown when PyQtGraph tries to put TensorFlow stuff onto a QGraphicsScene() on cleanup - see https://github.com/pyqtgraph/pyqtgraph/issues/603 and https://stackoverflow.com/questions/41542571/pyqtgraph-tries-to-put-tensorflow-stuff-onto-a-qgraphicsscene-on-cleanup
This commit is contained in:
James 2017-12-18 15:57:31 +00:00
parent 4752b77792
commit b9c7e379f3

View File

@ -320,7 +320,7 @@ def cleanup():
'are properly called before app shutdown (%s)\n' % (o,)) 'are properly called before app shutdown (%s)\n' % (o,))
s.addItem(o) s.addItem(o)
except RuntimeError: ## occurs if a python wrapper no longer has its underlying C++ object except (RuntimeError, ReferenceError): ## occurs if a python wrapper no longer has its underlying C++ object
continue continue
_cleanupCalled = True _cleanupCalled = True