io.StringIO has no attribute 'reset'.

This commit is contained in:
Valentin Lorentz 2013-06-29 23:19:38 +02:00
parent 46b89cfc0e
commit ed193e7cc7

View File

@ -165,13 +165,13 @@ def upkeep():
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.reset() # Seeks to 0. sys.stdout.seek(0)
sys.stdout.truncate() # Truncates to current offset. sys.stdout.truncate() # Truncates to current offset.
assert not type(sys.stderr) == file, 'Not a StringIO object!' assert not type(sys.stderr) == file, 'Not a StringIO object!'
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.reset() # Seeks to 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: