colour.utilities.suppress_warnings#

colour.utilities.suppress_warnings(colour_runtime_warnings: bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None = None, colour_usage_warnings: bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None = None, colour_warnings: bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None = None, python_warnings: bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None = None) Generator[source]#

Define a context manager filtering Colour and also optionally overall Python warnings.

The possible values for all the actions, i.e. each argument, are as follows:

  • None (No action is taken)

  • True (ignore)

  • False (default)

  • error

  • ignore

  • always

  • default

  • module

  • once

Parameters:
  • colour_runtime_warnings (bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None) – Whether to filter Colour runtime warnings according to the action value.

  • colour_usage_warnings (bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None) – Whether to filter Colour usage warnings according to the action value.

  • colour_warnings (bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None) – Whether to filter Colour warnings, this also filters Colour usage and runtime warnings according to the action value.

  • python_warnings (bool | Literal['default', 'error', 'ignore', 'always', 'module', 'once'] | None) – Whether to filter Python warnings according to the action value.

Return type:

Generator