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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user