From 1d86e322e9f6ebccd3bbc5795a6e20fc29b42c4a Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 7 Nov 2023 14:30:39 +1000 Subject: [PATCH] Do not compute checksums on macOS --- gns3server/main.py | 6 ++---- gns3server/web/web_server.py | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gns3server/main.py b/gns3server/main.py index cc075f3a..255bfc5a 100644 --- a/gns3server/main.py +++ b/gns3server/main.py @@ -77,13 +77,11 @@ def main(): Entry point for GNS3 server """ - if hasattr(sys, "frozen"): - multiprocessing.freeze_support() - multiprocessing.set_start_method("spawn") - if not sys.platform.startswith("win"): if "--daemon" in sys.argv: daemonize() + else: + multiprocessing.freeze_support() from gns3server.run import run run() diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py index b64970e4..c10c576b 100644 --- a/gns3server/web/web_server.py +++ b/gns3server/web/web_server.py @@ -29,7 +29,6 @@ import functools import time import atexit import weakref -import concurrent.futures # Import encoding now, to avoid implicit import later. # Implicit import within threads may cause LookupError when standard library is in a ZIP @@ -238,7 +237,11 @@ class WebServer: Compute image checksums. """ + if sys.platform.startswith("darwin") and hasattr(sys, "frozen"): + # do not compute on macOS because errors + return loop = asyncio.get_event_loop() + import concurrent.futures with concurrent.futures.ProcessPoolExecutor(max_workers=1) as pool: try: log.info("Computing image checksums...")