Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python warnings as error

# Warnings as errors for all the program
import warnings
warnings.filterwarnings("error")


# Warnings as errors whithin block
import warnings
with warnings.catch_warnings():
     warnings.simplefilter("error")
     # Code in this block will raise exception for a warning
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #warnings #error
ADD COMMENT
Topic
Name
4+5 =