# HG changeset patch # User Emmanuel Gil Peyrot # Date 1412788815 -7200 # Node ID 7a82c4b52b165d0d377e08577424f2c776fc90c8 # Parent 6c9d8a3d853f438d3baf2d9831698aae98dcde78 Prevent a traceback when we call Window.run without a runner set. diff --git a/pytouhou/ui/window.pyx b/pytouhou/ui/window.pyx --- a/pytouhou/ui/window.pyx +++ b/pytouhou/ui/window.pyx @@ -78,8 +78,6 @@ cdef class Runner: cdef class Window: def __init__(self, backend, long fps_limit=-1): - self.runner = None - if backend is not None: self.win = backend.create_window( 'PyTouhou', @@ -104,7 +102,8 @@ cdef class Window: while self.run_frame(): pass finally: - self.runner.finish() + if self.runner is not None: + self.runner.finish() cdef bint run_frame(self) except? False: