diff --git a/main.py b/main.py index 1bbfac7..3b6df63 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,14 @@ -import faulthandler import sys +# В windowed-сборке (PyInstaller --noconsole) stdout/stderr могут быть None. +# Подменяем их на devnull, чтобы print() и faulthandler не падали. +if sys.stderr is None: + sys.stderr = open("NUL", "w") # noqa: SIM115 +if sys.stdout is None: + sys.stdout = open("NUL", "w") # noqa: SIM115 + +import faulthandler + faulthandler.enable(file=sys.stderr) from app.entry import main