diff options
-rw-r--r-- | snakegame/engine.py | 7 | ||||
-rw-r--r-- | 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) |