0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-01-31 21:22:27 +00:00
termux-packages/packages/sabnzbd/webbrowser.patch
2024-02-14 08:38:10 +08:00

30 lines
852 B
Diff

diff --git a/sabnzbd/panic.py b/sabnzbd/panic.py
index 6e4b61f72..017dc9407 100644
--- a/sabnzbd/panic.py
+++ b/sabnzbd/panic.py
@@ -24,10 +24,7 @@ import logging
import tempfile
import ctypes
-try:
- import webbrowser
-except ImportError:
- webbrowser = None
+import subprocess
import sabnzbd
import sabnzbd.cfg as cfg
@@ -240,10 +237,7 @@ def launch_a_browser(url, force=False):
try:
if url and not url.startswith("http"):
url = "file:///%s" % url
- if webbrowser:
- webbrowser.open(url, 2, True)
- else:
- logging.info("Not showing panic message in webbrowser, no support found")
+ subprocess.call(["termux-open-url", url])
except:
logging.warning(T("Cannot launch the browser, probably not found"))
logging.info("Traceback: ", exc_info=True)