refactor: assorted: python: logger.warn -> logger.warning

the former is deprecated
This commit is contained in:
2024-07-27 01:48:13 +00:00
parent bf1f843306
commit eb3651ce59
4 changed files with 4 additions and 4 deletions

View File

@@ -75,7 +75,7 @@ def is_valid_search_domain(domain: str) -> bool:
if len(comps) >= 2:
# allow any search domain that's not a TLD.
return True
logger.warn(f"invalid search domain {domain}") # if you trigger this, then whitelist the search domain here
logger.warning(f"invalid search domain {domain}") # if you trigger this, then whitelist the search domain here
# it's ok to have a search domain of any length -- i'm just hesitant to allow hijacking of very large domain spaces.
return False

View File

@@ -61,7 +61,7 @@ def resolve_torrent(uri: str) -> str:
uri = f.name
if not (uri.startswith("magnet:") or uri.endswith(".torrent")):
logger.warn(f"unknown type for torrent URI: {uri}")
logger.warning(f"unknown type for torrent URI: {uri}")
return uri

View File

@@ -80,7 +80,7 @@ def tracker_rank(tracker: str):
tracker_ = tracker.lower()
if tracker_ in TRACKER_RANKS:
return TRACKER_RANKS.index(tracker_)
logger.warn(f"unknown tracker: {tracker_!r}")
logger.warning(f"unknown tracker: {tracker_!r}")
return len(TRACKER_RANKS)
DROP_CATS = { "dvd", "hd", "misc", "other", "sd", "uhd" }

View File

@@ -49,7 +49,7 @@ def get_fault_tolerant(try_upnp: bool, retry_duration: float) -> tuple[str|None,
try:
return try_get_once(try_upnp)
except Exception as e:
logger.warn(e)
logger.warning(e)
if time.time() - start > retry_duration:
raise
time.sleep(1.0)