Skip to content

errors: fix UNKNWON_DEVICE_TYPE misspelling, keep it as a compat alias - #846

Open
fametrano wants to merge 1 commit into
bitcoin-core:masterfrom
fametrano:fix/unknwon-device-type-typo
Open

errors: fix UNKNWON_DEVICE_TYPE misspelling, keep it as a compat alias#846
fametrano wants to merge 1 commit into
bitcoin-core:masterfrom
fametrano:fix/unknwon-device-type-typo

Conversation

@fametrano

Copy link
Copy Markdown
Contributor

Fixes #845.

UNKNWON_DEVICE_TYPE (error code -4, in hwilib/errors.py) is a transposition of "UNKNOWN". This adds the correctly-spelled UNKNOWN_DEVICE_TYPE and aliases the old name to it, rather than renaming outright: it's a public, documented module-level name (the module is automodule'd), so an external importer of the misspelled name should not break.

UnknownDeviceError now raises with the correct spelling. Its docstring's :data:DEVICE_TYPE`` cross-reference is also fixed — it pointed at a name that didn't exist under either spelling, so the Sphinx :data: role couldn't have resolved it before this either.

Out of scope for this PR: hwilib/devices/ledger_bitcoin/errors.py carries the same misspelling in a comment-credited copy of this file ("Original version: https://github.com/bitcoin-core/HWI"), vendored as part of the ledger_bitcoin client subpackage. I didn't touch it, since it's a separate vendored copy and not literally this file; flagging it here in case maintainers want it addressed too, either in this PR or separately.

No behavioural change: both names resolve to the same value, UnknownDeviceError().get_code() still returns -4.

UNKNWON_DEVICE_TYPE (error code -4) is a transposition of UNKNOWN. Add
the correctly-spelled UNKNOWN_DEVICE_TYPE and alias the old name to it
rather than renaming outright, since it is a public, documented
module-level name and an external importer of the misspelled name
should not break.

UnknownDeviceError now raises with the correct spelling, and its
docstring's `:data:`DEVICE_TYPE`` cross-reference — which pointed at a
name that does not exist either way — is fixed to point at the new one.

Fixes bitcoin-core#845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hwilib.errors: UNKNWON_DEVICE_TYPE is misspelled

1 participant