From 60ce541df6aa0bda66bc07a3894ab0e34f556a57 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Thu, 28 Sep 2017 09:05:31 -0700 Subject: [PATCH] minor argument type checking --- pyqtgraph/graphicsItems/ROI.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py index 850104c0..9f3dae6f 100644 --- a/pyqtgraph/graphicsItems/ROI.py +++ b/pyqtgraph/graphicsItems/ROI.py @@ -232,6 +232,9 @@ class ROI(GraphicsObject): multiple change functions to be called sequentially while minimizing processing overhead and repeated signals. Setting ``update=False`` also forces ``finish=False``. """ + if update not in (True, False): + raise TypeError("update argument must be bool") + if y is None: pos = Point(pos) else: @@ -249,6 +252,8 @@ class ROI(GraphicsObject): """Set the size of the ROI. May be specified as a QPoint, Point, or list of two values. See setPos() for an explanation of the update and finish arguments. """ + if update not in (True, False): + raise TypeError("update argument must be bool") size = Point(size) self.prepareGeometryChange() self.state['size'] = size @@ -259,6 +264,8 @@ class ROI(GraphicsObject): """Set the angle of rotation (in degrees) for this ROI. See setPos() for an explanation of the update and finish arguments. """ + if update not in (True, False): + raise TypeError("update argument must be bool") self.state['angle'] = angle tr = QtGui.QTransform() #tr.rotate(-angle * 180 / np.pi)