From 4b10ce3326e26b89e0de33ee48f07331cb2af0e9 Mon Sep 17 00:00:00 2001 From: Peter Ward Date: Sat, 19 Sep 2015 20:42:42 +1000 Subject: I have no idea what these are for, but they seem important. --- snakegame/engine.py | 7 ++++--- snakegame/viewers/pyglet.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/snakegame/engine.py b/snakegame/engine.py index 155e9bf..ec21e86 100644 --- a/snakegame/engine.py +++ b/snakegame/engine.py @@ -2,6 +2,7 @@ from collections import defaultdict, deque from copy import deepcopy from random import Random from string import ascii_lowercase as lowercase +import sys import time import traceback @@ -191,10 +192,10 @@ class Engine(object): self.remove_bot(letter) except: - print("Exception in bot %s (%s):" % (letter.upper(), bot)) - print('-'*60) + sys.stderr.write("Exception in bot %s (%s):\n" % (letter.upper(), bot)) + sys.stderr.write('-'*60+'\n') traceback.print_exc() - print('-'*60) + sys.stderr.write('-'*60+'\n') self.remove_bot(letter) def __iter__(self): diff --git a/snakegame/viewers/pyglet.py b/snakegame/viewers/pyglet.py index c5b7e0f..15d3ac9 100644 --- a/snakegame/viewers/pyglet.py +++ b/snakegame/viewers/pyglet.py @@ -42,7 +42,7 @@ class Viewer(pyglet.window.Window): if columns != self.columns or rows != self.rows: self.columns = columns self.rows = rows - self.on_resize(self.width, self.height) + self.set_size(self.width, self.height) def on_resize(self, width, height): super(Viewer, self).on_resize(width, height) -- cgit v1.2.3