From 100da814c96b24fa192e37c0e7ce49481f4969b3 Mon Sep 17 00:00:00 2001 From: John Kurkowski Date: Tue, 12 Nov 2024 22:04:17 -0800 Subject: [PATCH] Simplify --- tldextract/remote.py | 2 +- tldextract/tldextract.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tldextract/remote.py b/tldextract/remote.py index 8ac83111..faccabe3 100644 --- a/tldextract/remote.py +++ b/tldextract/remote.py @@ -46,7 +46,7 @@ def _schemeless_url(url: str) -> str: return url[2:] if ( double_slashes_start < 2 - or not url[double_slashes_start - 1] == ":" + or url[double_slashes_start - 1] != ":" or set(url[: double_slashes_start - 1]) - scheme_chars_set ): return url diff --git a/tldextract/tldextract.py b/tldextract/tldextract.py index 470e0981..667c36a3 100644 --- a/tldextract/tldextract.py +++ b/tldextract/tldextract.py @@ -297,9 +297,9 @@ def _extract_netloc( len(netloc_with_ascii_dots) >= min_num_ipv6_chars and netloc_with_ascii_dots[0] == "[" and netloc_with_ascii_dots[-1] == "]" + and looks_like_ipv6(netloc_with_ascii_dots[1:-1]) ): - if looks_like_ipv6(netloc_with_ascii_dots[1:-1]): - return ExtractResult("", netloc_with_ascii_dots, "", is_private=False) + return ExtractResult("", netloc_with_ascii_dots, "", is_private=False) labels = netloc_with_ascii_dots.split(".")