mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-04-11 12:02:05 -07:00
Merge 326e3a6976 into 95cc4489d0
This commit is contained in:
commit
874f730da9
1 changed files with 3 additions and 3 deletions
|
|
@ -101,7 +101,7 @@ def public_ip(proxy: Optional[str] = None) -> str:
|
||||||
"https://ipecho.net/plain",
|
"https://ipecho.net/plain",
|
||||||
]
|
]
|
||||||
|
|
||||||
exception = None
|
end_exception = None
|
||||||
for url in URLS:
|
for url in URLS:
|
||||||
try:
|
try:
|
||||||
with _suppress_insecure_warning():
|
with _suppress_insecure_warning():
|
||||||
|
|
@ -116,5 +116,5 @@ def public_ip(proxy: Optional[str] = None) -> str:
|
||||||
validate_ip(ip)
|
validate_ip(ip)
|
||||||
return ip
|
return ip
|
||||||
except (requests.exceptions.ProxyError, requests.RequestException, InvalidIP) as exception:
|
except (requests.exceptions.ProxyError, requests.RequestException, InvalidIP) as exception:
|
||||||
pass
|
end_exception = exception
|
||||||
raise InvalidIP(f"Failed to get IP address: {exception}")
|
raise InvalidIP(f"Failed to get IP address: {end_exception}")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue