Skip to content

Commit

Permalink
ni_osa: Use correct dict key in clear() on failure
Browse files Browse the repository at this point in the history
The key is supposed to be the name, not the
configuration dict, which caused a TypeError.

This might fix #54.
  • Loading branch information
dnadlinger committed Oct 5, 2024
1 parent f25b8f5 commit df431b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wand/drivers/ni_osa.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ def __init__(self, osas, simulation=False):

def clear(self):
""" Stops and clears all NI DAQ tasks we have created """
for _, osa in self.osas.items():
task_handle = self.handles.get(osa)
for name in self.osas.keys():
task_handle = self.handles.get(name)
if task_handle is not None:
try:
PyDAQmx.DAQmxStopTask(task_handle)
finally:
PyDAQmx.DAQmxClearTask(task_handle)
self.handles[osa] = None
self.handles[name] = None

def get_trace(self, osa, timeout=10):
""" Captures and returns an OSA trace.
Expand Down

0 comments on commit df431b3

Please sign in to comment.