Skip to content

Commit d0e3943

Browse files
Fix cast
1 parent e9fcdc4 commit d0e3943

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tools/python/mbed_tools/devices/_internal/darwin/system_profiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import plistlib
1010
import re
1111
import subprocess
12-
from typing import Dict, Iterable, List, cast
12+
from typing import Dict, Iterable, List, cast, Union
1313

1414
from typing_extensions import TypedDict
1515

@@ -37,7 +37,7 @@ def get_all_usb_devices_data() -> List[USBDeviceTree | USBDevice]:
3737
"""Returns parsed output of `system_profiler` call."""
3838
output = subprocess.check_output(["/usr/sbin/system_profiler", "-xml", "SPUSBDataType"], stderr=subprocess.DEVNULL)
3939
if output:
40-
return cast(List[USBDeviceTree | USBDevice], plistlib.loads(output))
40+
return cast(List[Union[USBDeviceTree, USBDevice]], plistlib.loads(output))
4141
return []
4242

4343

tools/python_tests/mbed_tools/devices/_internal/darwin/test_system_profiler.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# SPDX-License-Identifier: Apache-2.0
44
#
55

6-
from __future__ import annotations
7-
86
import plistlib
97
from unittest import TestCase, mock
108

0 commit comments

Comments
 (0)