1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Fix object has no attribute 'flush' when using without a console (#8271)

fix
This commit is contained in:
Álvaro Somoza
2024-05-28 17:19:01 -04:00
committed by GitHub
parent 67bef2027c
commit b2030a249c

View File

@@ -82,7 +82,9 @@ 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.
_default_handler.flush = sys.stderr.flush
if sys.stderr: # only if sys.stderr exists, e.g. when not using pythonw in windows
_default_handler.flush = sys.stderr.flush
# Apply our default configuration to the library root logger.
library_root_logger = _get_library_root_logger()