userscripts: Properly avoid tldextract warning

The previous fix in 3dc212a815 was insufficient,
as the inner `getattr(extract_result, "registered_domain")` was always evaluated
first (thus triggering the deprecation warning again).

We also cannot do:

    getattr(extract_result, "top_domain_under_public_suffix", None) or extract_result.registered_domain

as `""` is a valid value for it.
This commit is contained in:
Florian Bruhin 2025-04-17 11:11:33 +02:00 committed by Chad Kouse
parent eade090648
commit 37e1e50789
No known key found for this signature in database
GPG Key ID: 2BBC602A2578C7A2
4 changed files with 20 additions and 12 deletions

View File

@ -19,6 +19,14 @@ breaking changes (such as renamed commands) can happen in minor releases.
v3.5.1 (unreleased)
-------------------
Fixed
~~~~~
- Resolved issues in userscripts:
* `qute-bitwarden`, `-lastpass` and `-pass` now properly avoid a
`DeprecationWarning` from the upcoming 6.0 release of `tldextract`.
The previous fix in v3.5.1 was insufficient.
[[v3.5.0]]
v3.5.0 (2025-04-12)
-------------------

View File

@ -208,10 +208,10 @@ def main(arguments):
None,
[
extract_result.fqdn,
getattr(
extract_result,
"top_domain_under_public_suffix",
getattr(extract_result, "registered_domain"),
(
extract_result.top_domain_under_public_suffix
if hasattr(extract_result, "top_domain_under_public_suffix")
else extract_result.registered_domain
),
extract_result.subdomain + "." + extract_result.domain,
extract_result.domain,

View File

@ -121,10 +121,10 @@ def main(arguments):
None,
[
extract_result.fqdn,
getattr(
extract_result,
"top_domain_under_public_suffix",
getattr(extract_result, "registered_domain"),
(
extract_result.top_domain_under_public_suffix
if hasattr(extract_result, "top_domain_under_public_suffix")
else extract_result.registered_domain
),
extract_result.subdomain + extract_result.domain,
extract_result.domain,

View File

@ -247,10 +247,10 @@ def main(arguments):
None,
[
extract_result.fqdn,
getattr(
extract_result,
"top_domain_under_public_suffix",
getattr(extract_result, "registered_domain"),
(
extract_result.top_domain_under_public_suffix
if hasattr(extract_result, "top_domain_under_public_suffix")
else extract_result.registered_domain
),
extract_result.ipv4,
private_domain,