mirror of
https://github.com/mikf/gallery-dl.git
synced 2025-02-01 12:01:41 +01:00
prevent crash when 'stdout.line_buffering' is not defined (#642)
This commit is contained in:
parent
c9a2be36d4
commit
e46efbd5b5
@ -254,14 +254,14 @@ def stderr_write_flush(s):
|
||||
sys.stderr.flush()
|
||||
|
||||
|
||||
if sys.stdout.line_buffering:
|
||||
if getattr(sys.stdout, "line_buffering", None):
|
||||
def stdout_write(s):
|
||||
sys.stdout.write(s)
|
||||
else:
|
||||
stdout_write = stdout_write_flush
|
||||
|
||||
|
||||
if sys.stderr.line_buffering:
|
||||
if getattr(sys.stderr, "line_buffering", None):
|
||||
def stderr_write(s):
|
||||
sys.stderr.write(s)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user