From e4165aecf226757e39568f885d0e21dc140cd908 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 22 Oct 2015 11:00:11 +0800 Subject: [PATCH] gui/displays: do not test for empty list using bool conversion (breaks for numpy arrays). Closes #153 --- artiq/gui/displays.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/gui/displays.py b/artiq/gui/displays.py index a08aed041..5fb8069fc 100644 --- a/artiq/gui/displays.py +++ b/artiq/gui/displays.py @@ -137,7 +137,7 @@ class XYDisplay(dockarea.Dock): error = data.get(result_error, None) fit = data.get(result_fit, None) - if not y or len(y) != len(x): + if not len(y) or len(y) != len(x): return if error is not None and hasattr(error, "__len__"): if not len(error): @@ -201,7 +201,7 @@ class HistogramDisplay(dockarea.Dock): if x is None: x = list(range(len(y)+1)) - if y and len(x) == len(y) + 1: + if len(y) and len(x) == len(y) + 1: self.plot.clear() self.plot.plot(x, y, stepMode=True, fillLevel=0, brush=(0, 0, 255, 150))