Skip to content

Commit

Permalink
fixed mypy job in test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Lu Baumann committed Sep 25, 2024
1 parent 35b687e commit e566a45
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hyperlink/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,6 @@ def __init__(
)

_, self._host = parse_host(_textcheck("host", host, "/?#@"))
# Compute only if needed
self._host_is_ipv6_literal = None
if isinstance(path, Text):
raise TypeError(
"expected iterable of text for path, not: %r" % (path,)
Expand Down Expand Up @@ -1198,7 +1196,7 @@ def _host_idna_error(self):
idna does not encode empty strings and ipv6 addresses.
This is by design.
"""
if self._host_is_ipv6_literal is None:
if not hasattr(self, "_host_is_ipv6_literal"):
try:
socket.inet_pton(socket.AF_INET6, self.host)
self._host_is_ipv6_literal = True
Expand Down

0 comments on commit e566a45

Please sign in to comment.