mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01: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:
parent
649ceda8a5
commit
ca35dc2fdd
|
|
@ -241,7 +241,7 @@ def wait_for_connection(addr, port, timeout=15, attempt_cnt=5):
|
||||||
try:
|
try:
|
||||||
with socket.create_connection((addr, port), timeout=timeout):
|
with socket.create_connection((addr, port), timeout=timeout):
|
||||||
return
|
return
|
||||||
except (ConnectionRefusedError, socket.timeout): # noqa: PERF203
|
except (ConnectionRefusedError, TimeoutError): # noqa: PERF203
|
||||||
if i == attempt_cnt - 1:
|
if i == attempt_cnt - 1:
|
||||||
raise
|
raise
|
||||||
time.sleep(timeout)
|
time.sleep(timeout)
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,6 @@ ignore = [
|
||||||
"UP035",
|
"UP035",
|
||||||
"UP036",
|
"UP036",
|
||||||
"UP038",
|
"UP038",
|
||||||
"UP041",
|
|
||||||
"FURB161",
|
"FURB161",
|
||||||
]
|
]
|
||||||
select = [
|
select = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user