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

[no changelog] as the changelog entry is explicitly added to previous
version
pull/1802/head
matejcik 3 years ago committed by matejcik
parent 6f1005b155
commit f083beb3c2

@ -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/),
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]: 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
[#1363]: https://github.com/trezor/trezor-firmware/issues/1363
[#1738]: https://github.com/trezor/trezor-firmware/issues/1738
[#1798]: https://github.com/trezor/trezor-firmware/issues/1798

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

Loading…
Cancel
Save