From b9c7e379f37d54902f1a6c130fa959c149c5900c Mon Sep 17 00:00:00 2001 From: James Date: Mon, 18 Dec 2017 15:57:31 +0000 Subject: [PATCH] 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 --- pyqtgraph/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/__init__.py b/pyqtgraph/__init__.py index 24653207..412c8627 100644 --- a/pyqtgraph/__init__.py +++ b/pyqtgraph/__init__.py @@ -320,7 +320,7 @@ def cleanup(): 'are properly called before app shutdown (%s)\n' % (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 _cleanupCalled = True