1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

fix(python/trezorctl): fix "invalid value" of ChoiceType with default

[no changelog] as the changelog entry is explicitly added to previous
version
This commit is contained in:
matejcik 2021-09-07 12:21:37 +02:00 committed by matejcik
parent 6f1005b155
commit f083beb3c2
2 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.12.4] - 2021-09-07
[0.12.4]: https://github.com/trezor/trezor-firmware/compare/python/v0.12.3...python/v0.12.4
### Fixed
- trezorctl: fixed "Invalid value for <param>" when using Click 8 and param is not specified [#1798]
## [0.12.3] - 2021-07-29 ## [0.12.3] - 2021-07-29
[0.12.3]: https://github.com/trezor/trezor-firmware/compare/python/v0.12.2...python/v0.12.3 [0.12.3]: https://github.com/trezor/trezor-firmware/compare/python/v0.12.2...python/v0.12.3
@ -507,3 +514,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#1296]: https://github.com/trezor/trezor-firmware/issues/1296 [#1296]: https://github.com/trezor/trezor-firmware/issues/1296
[#1363]: https://github.com/trezor/trezor-firmware/issues/1363 [#1363]: https://github.com/trezor/trezor-firmware/issues/1363
[#1738]: https://github.com/trezor/trezor-firmware/issues/1738 [#1738]: https://github.com/trezor/trezor-firmware/issues/1738
[#1798]: https://github.com/trezor/trezor-firmware/issues/1798

View File

@ -32,6 +32,8 @@ class ChoiceType(click.Choice):
self.typemap = typemap self.typemap = typemap
def convert(self, value, param, ctx): def convert(self, value, param, ctx):
if value in self.typemap.values():
return value
value = super().convert(value, param, ctx) value = super().convert(value, param, ctx)
return self.typemap[value] return self.typemap[value]