summaryrefslogtreecommitdiffstats
path: root/gallery_dl/output.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2020-03-28 23:01:51 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2020-03-28 23:01:51 -0400
commite4887ae6b00c50fbbde531cc274c77b076bd821d (patch)
tree051849d0ce8ed35aa229ba828a2dfe1faf10c5c0 /gallery_dl/output.py
parente8cc000750de972384f2f34d02d42222b4018ae9 (diff)
New upstream version 1.13.3upstream/1.13.3
Diffstat (limited to 'gallery_dl/output.py')
-rw-r--r--gallery_dl/output.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/gallery_dl/output.py b/gallery_dl/output.py
index f084950..9e2f8a6 100644
--- a/gallery_dl/output.py
+++ b/gallery_dl/output.py
@@ -149,12 +149,13 @@ def replace_std_streams(errors="replace"):
"""Replace standard streams and set their error handlers to 'errors'"""
for name in ("stdout", "stdin", "stderr"):
stream = getattr(sys, name)
- setattr(sys, name, stream.__class__(
- stream.buffer,
- errors=errors,
- newline=stream.newlines,
- line_buffering=stream.line_buffering,
- ))
+ if stream:
+ setattr(sys, name, stream.__class__(
+ stream.buffer,
+ errors=errors,
+ newline=stream.newlines,
+ line_buffering=stream.line_buffering,
+ ))
# --------------------------------------------------------------------