Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

Commit 82079d1

Browse files
committed
Removed checks to COMResult.exception length in internal code as it is sufficient to just check COMResult.status.
1 parent f02b1d8 commit 82079d1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Version 0.6.0
1414
* ``UOSDevice.device`` set protected to avoid confusion and misuse.
1515
This is primarily for internal use and where it is required for clients
1616
getter methods such as ``get_pin`` should be provided.
17+
* Removed checks to ``COMResult.exception`` length in internal code as it is
18+
sufficient to just check ``COMResult.status``.
1719

1820
Version 0.5.0
1921
-------------

uoshardware/abstractions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ class Device:
337337

338338
def update_adc_samples(self, result: ComResult):
339339
"""Update the pin samples with the response of a get_adc_input."""
340-
if not result.status or len(result.exception) != 0:
340+
if not result.status:
341341
raise UOSRuntimeError("Can't update ADC samples from a failed response.")
342342
if result.tx_packet is None or len(result.rx_packets) < 1:
343343
raise UOSRuntimeError("Can't update ADC samples without a valid result.")
@@ -367,7 +367,7 @@ def update_adc_samples(self, result: ComResult):
367367

368368
def update_gpio_samples(self, result: ComResult):
369369
"""Update the pin samples with the response of a get_gpio_inpout."""
370-
if not result.status or len(result.exception) != 0:
370+
if not result.status:
371371
raise UOSRuntimeError("Can't update GPIO samples from a failed responsee.")
372372
if result.tx_packet is None or len(result.rx_packets) < 1:
373373
raise UOSRuntimeError("Can't update GPIO samples without a valid result.")

0 commit comments

Comments
 (0)