Remove early return in upkeep() in case sys.stdout is replaced.

We don't want flushing to be entirely skipped just because
of that.
This commit is contained in:
Valentin Lorentz 2019-11-01 22:18:32 +01:00
parent 57dee45734
commit 10ccfbbf3c
1 changed files with 12 additions and 12 deletions

View File

@ -154,9 +154,9 @@ def upkeep():
if not hasattr(sys.stdout, 'getvalue'):
# Stupid twisted sometimes replaces our stdout with theirs, because
# "The Twisted Way Is The Right Way" (ha!). So we're stuck simply
# returning.
# skipping the checks
log.warning('Expected cStringIO as stdout, got %r.', sys.stdout)
return
else:
s = sys.stdout.getvalue()
if s:
log.warning('Printed to stdout after daemonization: %s', s)