Skip to content

Commit 5923147

Browse files
Apply ruff/pyupgrade rule UP041
UP041 Replace aliased errors with `TimeoutError`
1 parent 625ec9a commit 5923147

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

distributed/deploy/old_ssh.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import logging
44
import os
5-
import socket
65
import sys
76
import traceback
87
import warnings
@@ -136,7 +135,7 @@ def read_from_stdout():
136135
)
137136
)
138137
line = stdout.readline()
139-
except (PipeTimeout, socket.timeout):
138+
except (TimeoutError, PipeTimeout):
140139
pass
141140

142141
def read_from_stderr():
@@ -155,7 +154,7 @@ def read_from_stderr():
155154
+ bcolors.ENDC
156155
)
157156
line = stderr.readline()
158-
except (PipeTimeout, socket.timeout):
157+
except (TimeoutError, PipeTimeout):
159158
pass
160159

161160
def communicate():

0 commit comments

Comments
 (0)