From 502b534e50737372d9e48b9c3e063b3281988b82 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 26 Jan 2019 17:53:53 +0100 Subject: Small correction for macOS 10.13.6 Signed-off-by: Szczepan Zalega --- unittest/test_storage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'unittest') diff --git a/unittest/test_storage.py b/unittest/test_storage.py index b4b21ea..53ad006 100644 --- a/unittest/test_storage.py +++ b/unittest/test_storage.py @@ -499,13 +499,16 @@ def test_export_firmware_extended_macos(C): device_item = None for item in devices: + if '_items' in item: + # Fix for macOS 10.13.6, Python 3.6.2 + item = item['_items'][0] if 'manufacturer' in item and item['manufacturer'] == 'Nitrokey': device_item = item # Try to get first volume of USB device try: volume = device_item['Media'][0]['volumes'][0] - except KeyError: + except (KeyError, TypeError): volume = None assert volume is not None, 'could not determine volume' -- cgit v1.2.3