Skip to content

Commit d38cc92

Browse files
committed
Fix lint: use contextlib.suppress in cool_off_until (SIM105)
1 parent dd331e7 commit d38cc92

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

aws/lambda/github-status-test/lambda_function.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2019-present, Facebook, Inc.
22

33
import base64
4+
import contextlib
45
import gzip
56
import json
67
import os
@@ -54,10 +55,8 @@ def app_private_key():
5455
def cool_off_until(response):
5556
reset = response.headers.get("x-ratelimit-reset")
5657
if reset:
57-
try:
58+
with contextlib.suppress(ValueError):
5859
return float(reset)
59-
except ValueError:
60-
pass
6160
return time.time() + DEFAULT_COOL_OFF
6261

6362

0 commit comments

Comments
 (0)