Fix Python 3.14 Syntax warning on startup for invalid use of return in finally clauses

This commit is contained in:
JackDandy 2025-05-29 14:16:55 +01:00
parent 8d78e909c0
commit 14a13e8d6a
2 changed files with 10 additions and 9 deletions

View file

@ -31,6 +31,7 @@
* Change incorrect case of recommended RapidFuzz
* Change improve success rate of Flaresolver requests
* Add "Last Episode" to "Sort By" on the "Poster" layout in the "Show List" view
* Fix Python 3.14 compatibility issues
[develop changelog]

View file

@ -1011,15 +1011,15 @@ def get_url(url, # type: AnyStr
DOMAIN_FAILURES.inc_failure_count(url, ConnectionFail(**connection_fail_params))
save_failure(url, domain, log_failure_url, post_data, post_json)
if isinstance(raised, Exception):
if raise_exceptions or raise_status_code:
try:
if not hasattr(raised, 'text') and hasattr(response, 'text'):
raised.text = response.text
except (BaseException, Exception):
pass
raise raised
return
if isinstance(raised, Exception):
if raise_exceptions or raise_status_code:
try:
if not hasattr(raised, 'text') and hasattr(response, 'text'):
raised.text = response.text
except (BaseException, Exception):
pass
raise raised
return
if return_response:
result = response