diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2019-01-26 17:53:53 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2019-01-26 21:13:15 +0100 |
commit | 502b534e50737372d9e48b9c3e063b3281988b82 (patch) | |
tree | 6cc57f8230fcd60fd371831ef9357043965840fa /unittest | |
parent | 1e45aacdd9df8ca9322a8c68be488d92fa628cf8 (diff) | |
download | libnitrokey-502b534e50737372d9e48b9c3e063b3281988b82.tar.gz libnitrokey-502b534e50737372d9e48b9c3e063b3281988b82.tar.bz2 |
Small correction for macOS 10.13.6
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/test_storage.py | 5 |
1 files changed, 4 insertions, 1 deletions
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' |