def suppress(*exceptions):
"""
Return a context manager that suppresses any of the
specified exceptions if they occur in the body of a
with statement and then resumes execution with the
first statement following the end of the with statement.
"""
try:
yield
except exceptions:
pass
评论列表
文章目录