Merge lp:~3v1n0/autopilot/badwindow-errors-protect into lp:autopilot

Proposed by Marco Trevisan (Treviño)
Status: Needs review
Proposed branch: lp:~3v1n0/autopilot/badwindow-errors-protect
Merge into: lp:autopilot
Diff against target: 24 lines (+5/-2)
1 file modified
autopilot/process/_bamf.py (+5/-2)
To merge this branch: bzr merge lp:~3v1n0/autopilot/badwindow-errors-protect
Reviewer Review Type Date Requested Status
platform-qa-bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Approve
Andrea Azzarone (community) Approve
prod-platform-qa continuous-integration Pending
Review via email: mp+268467@code.launchpad.net

Commit message

Bamf: protect from BadWindow errors when getting the title

A bamf window might be still on bus, but actually closed at X level,
so we must protect from errors when trying to fetch properties.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christopher Lee (veebers) wrote :

This looks good to me, but I believe this is for the Unity test cases? If so this should be against https://code.launchpad.net/~autopilot/autopilot/legacy (autopilot-legacy, autopilot-desktop-legacy) which is under the stewardship of the Unity7 team.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ok thanks for pointing out.

It's still to keep track of this on trunk until there will X11 support btw.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

569. By Marco Trevisan (Treviño)

Bamf: protect from BadWindow errors when getting the title

A bamf window might be still on bus, but actually closed at X level,
so we must protect from errors when trying to fetch properties.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/process/_bamf.py'
2--- autopilot/process/_bamf.py 2014-07-23 03:37:24 +0000
3+++ autopilot/process/_bamf.py 2015-08-19 11:09:29 +0000
4@@ -26,7 +26,7 @@
5 from gi.repository import GLib
6 import logging
7 import os
8-from Xlib import display, X, protocol
9+from Xlib import display, X, protocol, error as Xerror
10 from subprocess import check_output, CalledProcessError, call
11
12 import autopilot._glib
13@@ -483,7 +483,10 @@
14 .. note:: This may change depending on the current locale.
15
16 """
17- return self._getProperty('_NET_WM_NAME')
18+ try:
19+ return self._getProperty('_NET_WM_NAME')
20+ except Xerror.BadWindow:
21+ return self.name
22
23 @property
24 def geometry(self):

Subscribers

People subscribed via source and target branches