from circuitbreaker import circuit @circuit(failure_threshold=10, expected_exception=ConnectionError) def external_call(): ...