[`logging.py`] set default `stderr` path if `None` (#25033)
set default logger
This commit is contained in:
parent
c9a82be592
commit
0906d21203
|
@ -85,6 +85,10 @@ def _configure_library_root_logger() -> None:
|
|||
# This library has already configured the library root logger.
|
||||
return
|
||||
_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
|
||||
|
||||
# Apply our default configuration to the library root logger.
|
||||
|
|
Loading…
Reference in New Issue