Fix supybot-botchk's use of subprocess

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-11-28 17:48:03 -05:00
parent 89a535e8c1
commit a48cd109a3
1 changed files with 4 additions and 4 deletions

View File

@ -127,12 +127,12 @@ if __name__ == '__main__':
filename = os.path.join(home, filename)
if os.path.exists(filename):
debug('Found %s, sourcing.' % filename)
inst.communicate('source %s' % filename + os.linesep)
cmdline = "%s --daemon %s" % (options.supybot, options.conffile)
inst.stdin.write('source %s' % filename + os.linesep)
cmdline = '%s --daemon %s' % (options.supybot, options.conffile)
debug('Sending cmdline to sh process.')
(stdout, _) = inst.communicate(cmdline + os.linesep)
inst.stdin.write(cmdline + os.linesep)
inst.stdin.close()
debug('Received from sh process: %r' % stdout)
debug('Received from sh process: %r' % inst.stdout.read())
ret = inst.wait()
debug('Bot started, command line %r returned %s.' % (cmdline, ret))
sys.exit(ret)