Skip to content

Commit b077d6f

Browse files
author
Lu Baumann
committed
fixed typing for mypy tests
1 parent 35b687e commit b077d6f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/hyperlink/_url.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,6 @@ def __init__(
10191019
)
10201020

10211021
_, self._host = parse_host(_textcheck("host", host, "/?#@"))
1022-
# Compute only if needed
1023-
self._host_is_ipv6_literal = None
10241022
if isinstance(path, Text):
10251023
raise TypeError(
10261024
"expected iterable of text for path, not: %r" % (path,)
@@ -1198,7 +1196,7 @@ def _host_idna_error(self):
11981196
idna does not encode empty strings and ipv6 addresses.
11991197
This is by design.
12001198
"""
1201-
if self._host_is_ipv6_literal is None:
1199+
if not hasattr(self, "_host_is_ipv6_literal"):
12021200
try:
12031201
socket.inet_pton(socket.AF_INET6, self.host)
12041202
self._host_is_ipv6_literal = True

0 commit comments

Comments
 (0)