Unverified Commit 0906d212 authored by Arthur's avatar Arthur Committed by GitHub
Browse files

[`logging.py`] set default `stderr` path if `None` (#25033)

set default logger
parent c9a82be5
...@@ -85,6 +85,10 @@ def _configure_library_root_logger() -> None: ...@@ -85,6 +85,10 @@ def _configure_library_root_logger() -> None:
# This library has already configured the library root logger. # This library has already configured the library root logger.
return return
_default_handler = logging.StreamHandler() # Set sys.stderr as stream. _default_handler = logging.StreamHandler() # Set sys.stderr as stream.
# set defaults based on https://github.com/pyinstaller/pyinstaller/issues/7334#issuecomment-1357447176
if sys.stderr is None:
sys.stderr = open(os.devnull, "w")
_default_handler.flush = sys.stderr.flush _default_handler.flush = sys.stderr.flush
# Apply our default configuration to the library root logger. # Apply our default configuration to the library root logger.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment