Skip to content

Commit e4165ae

Browse files
committedOct 22, 2015
gui/displays: do not test for empty list using bool conversion (breaks for numpy arrays). Closes #153
1 parent 50809e0 commit e4165ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎artiq/gui/displays.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def update_data(self, data):
137137
error = data.get(result_error, None)
138138
fit = data.get(result_fit, None)
139139

140-
if not y or len(y) != len(x):
140+
if not len(y) or len(y) != len(x):
141141
return
142142
if error is not None and hasattr(error, "__len__"):
143143
if not len(error):
@@ -201,7 +201,7 @@ def update_data(self, data):
201201
if x is None:
202202
x = list(range(len(y)+1))
203203

204-
if y and len(x) == len(y) + 1:
204+
if len(y) and len(x) == len(y) + 1:
205205
self.plot.clear()
206206
self.plot.plot(x, y, stepMode=True, fillLevel=0,
207207
brush=(0, 0, 255, 150))

0 commit comments

Comments
 (0)
Please sign in to comment.