Skip to content

Commit 9f05351

Browse files
committed
[ot] scripts/opentitan: use Python 3.9 syntax for type unions
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
1 parent cd230b4 commit 9f05351

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/opentitan/flashgen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
join as joinpath, normpath)
1919
from struct import calcsize as scalc, pack as spack, unpack as sunpack
2020
from traceback import format_exc
21-
from typing import Any, BinaryIO, NamedTuple, Optional
21+
from typing import Any, BinaryIO, NamedTuple, Optional, Union
2222
import re
2323
import sys
2424

@@ -216,7 +216,7 @@ def info_part_size(cls) -> int:
216216
return sum(cls.INFOS) * cls.BYTES_PER_PAGE
217217

218218
def read_boot_info(self) -> dict[BootLocation,
219-
dict[str, [int | bytes]]]:
219+
dict[str, Union[int, bytes]]]:
220220
size = self._boot_header_size
221221
fmt = ''.join(self.BOOT_HEADER_FORMAT.values())
222222
boot_entries = {}

scripts/opentitan/gdbreplay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
timeout as LegacyTimeoutError)
1818
from string import ascii_uppercase
1919
from traceback import format_exc
20-
from typing import BinaryIO, Optional, TextIO
20+
from typing import BinaryIO, Optional, TextIO, Union
2121
import re
2222
import sys
2323

@@ -461,7 +461,7 @@ def _send(self, payload: str):
461461
self._log.info('Reply: "%s"', payload)
462462
self._send_bytes(payload.encode())
463463

464-
def _send_bytes(self, payload: [bytes | bytearray]):
464+
def _send_bytes(self, payload: Union[bytes, bytearray]):
465465
"""Send a reply to the remote GDB client.
466466
467467
:param payload: the byte sequence to send

0 commit comments

Comments
 (0)