Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python suppress warnings in function

import warnings

def fxn():
    warnings.warn("deprecated", DeprecationWarning)

with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    fxn()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #suppress #warnings #function
ADD COMMENT
Topic
Name
8+9 =