Skip to content

Commit f487e59

Browse files
committed
small fix
1 parent 51ada5f commit f487e59

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/switchcraft/gui_modern/views/winget_view.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ def __init__(self, page: ft.Page):
4040
except Exception:
4141
pass
4242

43+
# Robustness: Check if we can still try to fallback to a local module if addon fails
44+
if not self.winget:
45+
try:
46+
from switchcraft_winget.utils.winget import WingetHelper
47+
self.winget = WingetHelper()
48+
except ImportError:
49+
pass
50+
4351
self.current_pkg = None
4452

4553
if not self.winget:

src/switchcraft/services/addon_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def __init__(self):
2828
def get_addon_dir():
2929
"""Returns the base directory for addons."""
3030
from switchcraft import IS_WEB
31+
import sys
3132
if IS_WEB:
3233
# In Web/Pyodide, we use the 'switchcraft.addons' package directory
3334
# assuming addons are baked into the package.

0 commit comments

Comments
 (0)