From 19c133e53dfa0d767e47a137129689435b637cf9 Mon Sep 17 00:00:00 2001 From: Eliot Blennerhassett Date: Fri, 28 Apr 2023 06:00:00 +1200 Subject: [PATCH] Ewb/usberr (#370) * usb: handle USBError in USBRaw get serial number Fixes pyvisa/pyvisa-py#363 Signed-off-by: Eliot Blennerhassett * Note for issue #363 --------- Signed-off-by: Eliot Blennerhassett --- CHANGES | 1 + pyvisa_py/usb.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 27c1fd92..39412b83 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ PyVISA-py Changelog - drop support for Python 3.7 PR #362 - fix listing of available resources PR #362 - fix hislip support for custom sub_addresses PR #359 +- fix bad USBRaw resource preventing enumeration of other resources 0.6.3 (17-02-2023) ------------------ diff --git a/pyvisa_py/usb.py b/pyvisa_py/usb.py index 9350c021..ac4324d7 100644 --- a/pyvisa_py/usb.py +++ b/pyvisa_py/usb.py @@ -315,7 +315,7 @@ def list_resources() -> List[str]: try: serial = dev.serial_number - except (NotImplementedError, ValueError): + except (NotImplementedError, ValueError, usb.USBError): msg = ( "Found a device whose serial number cannot be read." " The partial VISA resource name is: " + fmt