From b5d5d29d31b6bc4402a9182aaee7b91365969863 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Mon, 22 Nov 2021 09:07:15 +0100 Subject: #1065 Support pyinstaller for Windows Add required function call before running any process with multiprocessing. This is required for windows executables to work properly when using pyinstaller. See: https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing --- src/windows/ogOperations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/windows') diff --git a/src/windows/ogOperations.py b/src/windows/ogOperations.py index baafbd9..6bc5e93 100644 --- a/src/windows/ogOperations.py +++ b/src/windows/ogOperations.py @@ -11,7 +11,7 @@ import ctypes import subprocess from subprocess import CalledProcessError import multiprocessing as mp -from multiprocessing import Process +from multiprocessing import Process, freeze_support from PIL import Image, ImageDraw from pystray import Icon, Menu, MenuItem @@ -67,6 +67,7 @@ systray_p = Process(target=create_systray) class OgWindowsOperations: def __init__(self): + freeze_support() mp.set_start_method('spawn') systray_p.start() -- cgit v1.2.3-18-g5258