diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index b874a3c4..27fb8268 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -277,7 +277,7 @@ class ViewBox(GraphicsWidget): scene = self.scene() if scene == self._lastScene: return - if self._lastScene is not None and hasattr(self.lastScene, 'sigPrepareForPaint'): + if self._lastScene is not None and hasattr(self._lastScene, 'sigPrepareForPaint'): self._lastScene.sigPrepareForPaint.disconnect(self.prepareForPaint) if scene is not None and hasattr(scene, 'sigPrepareForPaint'): scene.sigPrepareForPaint.connect(self.prepareForPaint)