errors: fix UNKNWON_DEVICE_TYPE misspelling, keep it as a compat alias - #846
Open
fametrano wants to merge 1 commit into
Open
errors: fix UNKNWON_DEVICE_TYPE misspelling, keep it as a compat alias#846fametrano wants to merge 1 commit into
fametrano wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #845.
UNKNWON_DEVICE_TYPE(error code -4, inhwilib/errors.py) is a transposition of "UNKNOWN". This adds the correctly-spelledUNKNOWN_DEVICE_TYPEand aliases the old name to it, rather than renaming outright: it's a public, documented module-level name (the module isautomodule'd), so an external importer of the misspelled name should not break.UnknownDeviceErrornow 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.pycarries the same misspelling in a comment-credited copy of this file ("Original version: https://github.com/bitcoin-core/HWI"), vendored as part of theledger_bitcoinclient 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.