diff --git a/pixelflut/pixelflut.py b/pixelflut/pixelflut.py index caefe08..2ef32d0 100755 --- a/pixelflut/pixelflut.py +++ b/pixelflut/pixelflut.py @@ -249,7 +249,9 @@ def text(self, x, y, text, delay=0, linespace=1): canvas.fire('UNLOAD') canvas.events.clear() try: - execfile(brainfile, {'on':canvas.on, '__file__': brainfile}) + with open(brainfile) as f: + code = compile(f.read(), brainfile, 'exec') + exec(code, {'on':canvas.on, '__file__': brainfile}) except: log.exception('Brain failed') continue