mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
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:
parent
57dee45734
commit
10ccfbbf3c
24
src/world.py
24
src/world.py
@ -154,19 +154,19 @@ def upkeep():
|
|||||||
if not hasattr(sys.stdout, 'getvalue'):
|
if not hasattr(sys.stdout, 'getvalue'):
|
||||||
# Stupid twisted sometimes replaces our stdout with theirs, because
|
# Stupid twisted sometimes replaces our stdout with theirs, because
|
||||||
# "The Twisted Way Is The Right Way" (ha!). So we're stuck simply
|
# "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)
|
log.warning('Expected cStringIO as stdout, got %r.', sys.stdout)
|
||||||
return
|
else:
|
||||||
s = sys.stdout.getvalue()
|
s = sys.stdout.getvalue()
|
||||||
if s:
|
if s:
|
||||||
log.warning('Printed to stdout after daemonization: %s', s)
|
log.warning('Printed to stdout after daemonization: %s', s)
|
||||||
sys.stdout.seek(0)
|
sys.stdout.seek(0)
|
||||||
sys.stdout.truncate() # Truncates to current offset.
|
sys.stdout.truncate() # Truncates to current offset.
|
||||||
s = sys.stderr.getvalue()
|
s = sys.stderr.getvalue()
|
||||||
if s:
|
if s:
|
||||||
log.error('Printed to stderr after daemonization: %s', s)
|
log.error('Printed to stderr after daemonization: %s', s)
|
||||||
sys.stderr.seek(0)
|
sys.stderr.seek(0)
|
||||||
sys.stderr.truncate() # Truncates to current offset.
|
sys.stderr.truncate() # Truncates to current offset.
|
||||||
doFlush = conf.supybot.flush() and not starting
|
doFlush = conf.supybot.flush() and not starting
|
||||||
if doFlush:
|
if doFlush:
|
||||||
flush()
|
flush()
|
||||||
|
Loading…
Reference in New Issue
Block a user