Unverified Commit b2030a24 authored by Álvaro Somoza's avatar Álvaro Somoza Committed by GitHub
Browse files

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

fix
parent 67bef202
...@@ -82,6 +82,8 @@ def _configure_library_root_logger() -> None: ...@@ -82,6 +82,8 @@ 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.
if sys.stderr: # only if sys.stderr exists, e.g. when not using pythonw in windows
_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