click
click copied to clipboard
Pass 'color' explicitly in error echoing
- This fixes the error reported in https://github.com/pallets/click/issues/2193. Since the context has been popped at the point the error is printed,
resolve_color_defaultincorrectly returnsNoneand so the color is stripped from any color in error messages. This PR caches that setting in theClickExceptioninitialization and then passes it to theecholater on, thereby bypassing this check at the failing point
- fixes #2193
Checklist:
- [x] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
- [x] Add or update relevant docs, in the docs folder and in code.
- [x] Add an entry in
CHANGES.rstsummarizing the change and linking to the issue. - [x] Add
.. versionchanged::entries in any relevant code docs. - [x] Run
pre-commithooks and fix any issues. - [x] Run
pytestandtox, no tests failed.