From 18d5d8bd20e66bb9cf577d26899d4a2c5f1cd5ba Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 26 Apr 2014 13:45:26 +0200 Subject: external (?) bug workaround MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/x-window-focus | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'examples/x-window-focus') diff --git a/examples/x-window-focus b/examples/x-window-focus index cf5798b..3148a80 100644 --- a/examples/x-window-focus +++ b/examples/x-window-focus @@ -62,7 +62,11 @@ def x_window_focus_thread_function(proc): # Get window specifications wm_class = window.get_wm_class() - wm_name = window.get_wm_name() + wm_name = None + try: + wm_name = window.get_wm_name() + except: + pass ## Bug in python3-xlib (?) if (wm_class is None) and (wm_name is None): x_display.next_event() continue @@ -73,9 +77,10 @@ def x_window_focus_thread_function(proc): wm_name) #sys.stderr.buffer.write((repr(window) + '\n').encode('utf-8')) #sys.stderr.buffer.flush() - except: - x_display.next_event() - continue + finally: + pass + #x_display.next_event() + #continue # Check that something changed if (last is not None) and (last == window): -- cgit v1.2.3-70-g09d2