Skip to content

Commit 3253859

Browse files
committed
firmware: use typing.List instead of list for type hint
list is not subscriptable in Python 3.8. Fixes: File "/home/runner/work/pybricksdev/pybricksdev/pybricksdev/firmware.py", line 37, in <module> "mpy-cross-options": list[str], TypeError: 'type' object is not subscriptable
1 parent bd9876e commit 3253859

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Move/renamed `pybricksdev.flash.create_firmware` to `pybricksdev.firmware.create_firmware_blob`.
1717
- Changed return value of `pybricksdev.firmware.create_firmware_blob` to include license text.
1818

19+
### Fixed
20+
- Fixed "object is not subscriptable" error in Python 3.8 in `firmware` module.
21+
1922
## [1.0.0-alpha.30] - 2022-08-26
2023

2124
### Added

pybricksdev/firmware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import struct
1212
import sys
1313
import zipfile
14-
from typing import BinaryIO, Literal, Optional, Tuple, TypedDict, Union
14+
from typing import BinaryIO, List, Literal, Optional, Tuple, TypedDict, Union
1515

1616

1717
if sys.version_info < (3, 10):
@@ -34,7 +34,7 @@ class FirmwareMetadataV100(
3434
"device-id": Literal[0x40, 0x41, 0x80, 0x81],
3535
"checksum-type": Literal["sum", "crc32"],
3636
"mpy-abi-version": int,
37-
"mpy-cross-options": list[str],
37+
"mpy-cross-options": List[str],
3838
"user-mpy-offset": int,
3939
"max-firmware-size": int,
4040
},

0 commit comments

Comments
 (0)