Skip to content

How to suppressing warnings? #815

Answered by KelSolaar
ahemberger asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ahemberger,

What you are doing should work I think, here is what I would be expecting:

>>> import colour
>>> colour.utilities.filter_warnings(*[True] * 4)
>>> colour.utilities.runtime_warning('Hey!')
True
>>> colour.utilities.filter_warnings(*['default'] * 4)
>>> colour.utilities.runtime_warning('Hey!')
/Users/kelsolaar/Documents/Development/colour-science/colour/colour/utilities/verbose.py:235: ColourRuntimeWarning: Hey!
  warn(*args, **kwargs)
True
>>> colour.utilities.filter_warnings(*[True] * 4)
>>> colour.read_image('/Users/kelsolaar/Downloads/Colour_Normal_Observers_sRGB_Primaries_Red_Extreme.exr')
array([[[  1.00000000e+00,   6.24389648e-02,  -5.97381592e-03],
        [  1.0000…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ahemberger
Comment options

@KelSolaar
Comment options

Answer selected by ahemberger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants