Commit e226996c authored by Matthew Hausknecht's avatar Matthew Hausknecht

Silenced the agents stderr.

parent aa70c2bc
...@@ -13,7 +13,7 @@ class DoneError(Exception): ...@@ -13,7 +13,7 @@ class DoneError(Exception):
return 'Done due to %s' % self.msg return 'Done due to %s' % self.msg
class DummyPopen(object): class DummyPopen(object):
""" Emulates a Popen object. """ """ Emulates a Popen object without actually starting a process. """
def __init__(self, pid): def __init__(self, pid):
self.pid = pid self.pid = pid
def poll(self): def poll(self):
...@@ -94,7 +94,9 @@ class Trainer(object): ...@@ -94,7 +94,9 @@ class Trainer(object):
self._agentNumInt) self._agentNumInt)
agentCmd = 'start_agent.sh -t %s -u %i'%(self._agentTeam, self._agentNumExt) agentCmd = 'start_agent.sh -t %s -u %i'%(self._agentTeam, self._agentNumExt)
agentCmd = agentCmd.split(' ') agentCmd = agentCmd.split(' ')
p = subprocess.Popen(agentCmd) # Ignore stderr because librcsc continually prints to it
kwargs = {'stderr':open('/dev/null','w')}
p = subprocess.Popen(agentCmd, **kwargs)
p.wait() p.wait()
with open('/tmp/start%i' % p.pid,'r') as f: with open('/tmp/start%i' % p.pid,'r') as f:
output = f.read() output = f.read()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment