From a1980ff713aabd2fb7faf593551552ce32345741 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 7 Dec 2010 12:39:50 -0500 Subject: [PATCH] Print bot stderr if a bot dies before ending. --- table.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/table.py b/table.py index bea4513..b0d9556 100644 --- a/table.py +++ b/table.py @@ -41,11 +41,15 @@ class Player (object): def kill(self): if self._proc != None: - self._proc.stdin.write('END\n') - self._proc.stdin.flush() + try: + self._proc.stdin.write('END\n') + self._proc.stdin.flush() + except IOError, e: + pass + stdout,stderr = self._proc.communicate() exit_code = self._proc.wait() - assert exit_code == 0, 'Error exiting from %s: %d' % ( - self, exit_code) + assert exit_code == 0, 'Error exiting from %s: %d\n%s' % ( + self, exit_code, stderr) self._proc = None def __str__(self): -- 2.26.2