Commit b3dd6eb3 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Make HPIB raise a RuntimeError no 'no response'

parent 029e63ad
...@@ -44,7 +44,10 @@ class GPIBProtocol(serial.threaded.LineReader): ...@@ -44,7 +44,10 @@ class GPIBProtocol(serial.threaded.LineReader):
Returns: Returns:
If the command contains '?', the value returned by If the command contains '?', the value returned by
the HPIB device is returned, else None. the HPIB device is returned.
Raises:
RuntimeError: if no response was received to a query.
""" """
with self.lock: with self.lock:
if address: if address:
...@@ -56,7 +59,7 @@ class GPIBProtocol(serial.threaded.LineReader): ...@@ -56,7 +59,7 @@ class GPIBProtocol(serial.threaded.LineReader):
try: try:
line = self.responses.get(timeout=timeout) line = self.responses.get(timeout=timeout)
except queue.Empty: except queue.Empty:
return None raise RuntimeError("HPIB device at address did not respond to query:", command)
return line return line
else: else:
pass pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment