The following block of code will always raise ImportError if you have the latest version of webcolors installed, meaning that the contextlib.suppress block will always exit immediately, and these functions will never be defined; the block is now essentially dead code:
This is because webcolors made the CSS21_NAMES_TO_HEX constant private in webcolors==24.6.0 (released on June 6), so the statement from webcolors import CSS21_NAMES_TO_HEX now always raises ImportError. The diff between the latest version of webcolors and the release before it can be seen here: https://github.com/ubernostrum/webcolors/compare/1.13...24.6.0.
Obviously third parties should not be relying on any functions in the internal _format module, so this isn't a complaint! But we spotted this in typeshed's CI, and thought you might like to know.
(This issue isn't a complaint, just an FYI!)
The following block of code will always raise
ImportError
if you have the latest version ofwebcolors
installed, meaning that thecontextlib.suppress
block will always exit immediately, and these functions will never be defined; the block is now essentially dead code:https://github.com/python-jsonschema/jsonschema/blob/0024b584c6b6f332f0f5fa5452488901b73328f9/jsonschema/_format.py#L415-L429
This is because
webcolors
made theCSS21_NAMES_TO_HEX
constant private inwebcolors==24.6.0
(released on June 6), so the statementfrom webcolors import CSS21_NAMES_TO_HEX
now always raisesImportError
. The diff between the latest version ofwebcolors
and the release before it can be seen here: https://github.com/ubernostrum/webcolors/compare/1.13...24.6.0.Obviously third parties should not be relying on any functions in the internal
_format
module, so this isn't a complaint! But we spotted this in typeshed's CI, and thought you might like to know.