From c80a55b18c5137d730e18101c6d1315211a263e6 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 8 Nov 2022 23:07:45 +0800 Subject: [PATCH] Install appliances and configs without importlib_resources for Windows only --- gns3server/controller/__init__.py | 2 +- gns3server/controller/appliance_manager.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index 936b680a..5c5236b9 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -278,7 +278,7 @@ class Controller: dst_path = self.configs_path() try: - if hasattr(sys, "frozen"): + if hasattr(sys, "frozen") and sys.platform.startswith("win"): resource_path = os.path.normpath(os.path.join(os.path.dirname(sys.executable), "configs")) for filename in os.listdir(resource_path): if not os.path.exists(os.path.join(dst_path, filename)): diff --git a/gns3server/controller/appliance_manager.py b/gns3server/controller/appliance_manager.py index e0c74df6..d15fc69b 100644 --- a/gns3server/controller/appliance_manager.py +++ b/gns3server/controller/appliance_manager.py @@ -93,7 +93,7 @@ class ApplianceManager: dst_path = self._builtin_appliances_path() try: - if hasattr(sys, "frozen"): + if hasattr(sys, "frozen") and sys.platform.startswith("win"): resource_path = os.path.normpath(os.path.join(os.path.dirname(sys.executable), "appliances")) for filename in os.listdir(resource_path): if not os.path.exists(os.path.join(dst_path, filename)):