diff --git a/update.py b/update.py index 343a6df..d04b64c 100644 --- a/update.py +++ b/update.py @@ -27,6 +27,17 @@ import socket import subprocess import sys +# Suppress flashing console windows from child processes (powershell/git/pip/tesseract). +if os.name == "nt": + _CREATE_NO_WINDOW = 0x08000000 + _orig_popen_init = subprocess.Popen.__init__ + + def _popen_no_window(self, *a, **k): + k["creationflags"] = k.get("creationflags", 0) | _CREATE_NO_WINDOW + _orig_popen_init(self, *a, **k) + + subprocess.Popen.__init__ = _popen_no_window + HERE = os.path.dirname(os.path.abspath(__file__)) WIN = os.name == "nt" TASK = "EveWatcher"