summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ward <peteraward@gmail.com>2015-09-19 20:42:42 +1000
committerPeter Ward <peteraward@gmail.com>2015-09-19 20:42:42 +1000
commit4b10ce3326e26b89e0de33ee48f07331cb2af0e9 (patch)
tree7aa2dac33d5cf52dae7a90dbd9af11363ee760a4
parent985d2c0e98e1705f266ad2014976549841350a1d (diff)
I have no idea what these are for, but they seem important.HEADmaster
-rw-r--r--snakegame/engine.py7
-rw-r--r--snakegame/viewers/pyglet.py2
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)