Skip to content

Commit b853413

Browse files
authored
Narrow exception catch in DNSAddress.__repr__ to only expected exceptions (#473)
1 parent d0f5a60 commit b853413

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

zeroconf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def __repr__(self) -> str:
597597
socket.AF_INET6 if _is_v6_address(self.address) else socket.AF_INET, self.address
598598
)
599599
)
600-
except Exception: # pylint: disable=broad-except # TODO stop catching all Exceptions
600+
except (ValueError, OSError):
601601
return self.to_string(str(self.address))
602602

603603

0 commit comments

Comments
 (0)