diff --git a/python/.changelog.d/+4afd8b1d.fixed b/python/.changelog.d/+4afd8b1d.fixed new file mode 100644 index 0000000000..d10815d33a --- /dev/null +++ b/python/.changelog.d/+4afd8b1d.fixed @@ -0,0 +1 @@ +Use `frozenset` for `models.TREZORS` to prevent accidental modification. diff --git a/python/src/trezorlib/models.py b/python/src/trezorlib/models.py index 2fde03eb2d..b1d638a6fd 100644 --- a/python/src/trezorlib/models.py +++ b/python/src/trezorlib/models.py @@ -109,7 +109,7 @@ TREZOR_SAFE5 = T3T1 TREZOR_DISC1 = DISC1 TREZOR_DISC2 = DISC2 -TREZORS = {T1B1, T2T1, T2B1, T3T1, T3B1, DISC1, DISC2} +TREZORS = frozenset({T1B1, T2T1, T2B1, T3T1, T3B1, DISC1, DISC2}) def by_name(name: Optional[str]) -> Optional[TrezorModel]: