Skip to content

Commit c76993e

Browse files
Apply ruff/pyupgrade rule UP024
UP024 Replace aliased errors with `OSError`
1 parent c2e64fa commit c76993e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/test_dns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def test_getaddrinfo_close_loop(self):
248248
try:
249249
# Check that we have internet connection
250250
socket.getaddrinfo('example.com', 80)
251-
except socket.error:
251+
except OSError:
252252
raise unittest.SkipTest
253253

254254
async def run():

uvloop/_testbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def find_free_port(start_from=50000):
260260
with sock:
261261
try:
262262
sock.bind(('', port))
263-
except socket.error:
263+
except OSError:
264264
continue
265265
else:
266266
return port

0 commit comments

Comments
 (0)