Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

with suppress python

# The suppress suppresses the error and continues from after the 'with' statement.
from contextlib import suppress
with suppress(Exception):
    print("This will print")
    raise Exception
    print("This won't print")

print("This will also print")
 
PREVIOUS NEXT
Tagged: #suppress #python
ADD COMMENT
Topic
Name
9+2 =