[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:
Nikita Shulga
2025-09-23 10:55:03 -07:00
committed by PyTorch MergeBot
parent 649ceda8a5
commit ca35dc2fdd
2 changed files with 1 additions and 2 deletions

View File

@ -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)

View File

@ -189,7 +189,6 @@ ignore = [
"UP035",
"UP036",
"UP038",
"UP041",
"FURB161",
]
select = [