mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[EZ] Fix UP041 violations (#163648)
I.e. use `TimeoutError` instead of `socket.timeout` Pull Request resolved: https://github.com/pytorch/pytorch/pull/163648 Approved by: https://github.com/cyyever, https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
649ceda8a5
commit
ca35dc2fdd
@ -241,7 +241,7 @@ def wait_for_connection(addr, port, timeout=15, attempt_cnt=5):
|
||||
try:
|
||||
with socket.create_connection((addr, port), timeout=timeout):
|
||||
return
|
||||
except (ConnectionRefusedError, socket.timeout): # noqa: PERF203
|
||||
except (ConnectionRefusedError, TimeoutError): # noqa: PERF203
|
||||
if i == attempt_cnt - 1:
|
||||
raise
|
||||
time.sleep(timeout)
|
||||
|
@ -189,7 +189,6 @@ ignore = [
|
||||
"UP035",
|
||||
"UP036",
|
||||
"UP038",
|
||||
"UP041",
|
||||
"FURB161",
|
||||
]
|
||||
select = [
|
||||
|
Reference in New Issue
Block a user