From 31e933207f52fcb0c4100a7c48561a5a14c73ec8 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Wed, 12 Jul 2023 22:22:49 -0700 Subject: [PATCH] Set default values for sys.stdout if they're unavailable --- src/khoj/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/khoj/main.py b/src/khoj/main.py index 84815b63..4bdd9093 100644 --- a/src/khoj/main.py +++ b/src/khoj/main.py @@ -2,6 +2,12 @@ import os import signal import sys + +if sys.stdout is None: + sys.stdout = open(os.devnull, "w") +if sys.stderr is None: + sys.stderr = open(os.devnull, "w") + import logging import threading import warnings