If we do have wx installed but have no window, don't crash
authorPaul Robinson <darkraver@gmail.com>
Mon, 5 Nov 2012 16:43:16 +0000 (16:43 +0000)
committerPaul Robinson <darkraver@gmail.com>
Mon, 5 Nov 2012 16:43:16 +0000 (16:43 +0000)
debugEvent.py

index c6a57eb..555ed23 100644 (file)
@@ -27,7 +27,10 @@ try:
     EVT_DEBUG_ID = 1010
     
     def debug_display(window, position, message):
-        wx.PostEvent(window, DebugEvent([position, message]))
+        if window is None:
+            print message
+        else:
+            wx.PostEvent(window, DebugEvent([position, message]))
        
     class DebugEvent(wx.PyEvent):
         """Simple event to carry arbitrary result data."""