click icon indicating copy to clipboard operation
click copied to clipboard

Pass 'color' explicitly in error echoing

Open dzcode opened this issue 3 years ago • 0 comments

  • 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_default incorrectly returns None and so the color is stripped from any color in error messages. This PR caches that setting in the ClickException initialization and then passes it to the echo later 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.rst summarizing the change and linking to the issue.
  • [x] Add .. versionchanged:: entries in any relevant code docs.
  • [x] Run pre-commit hooks and fix any issues.
  • [x] Run pytest and tox, no tests failed.

dzcode avatar May 02 '22 23:05 dzcode