try:
division_by_zero = ext.is_division_by_zero_trapped() invalid = ext.is_invalid_trapped() overflow = ext.is_overflow_trapped() ext.trap_exceptions(division_by_zero=False,
invalid=False,
overflow=False)
finally:
ext.trap_exceptions(division_by_zero=division_by_zero,
invalid=invalid,
overflow=overflow)