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
=== modified file 'autopilot/process/_bamf.py'
--- autopilot/process/_bamf.py 2014-07-23 03:37:24 +0000
+++ autopilot/process/_bamf.py 2015-08-19 11:09:29 +0000
@@ -26,7 +26,7 @@
26from gi.repository import GLib26from gi.repository import GLib
27import logging27import logging
28import os28import os
29from Xlib import display, X, protocol29from Xlib import display, X, protocol, error as Xerror
30from subprocess import check_output, CalledProcessError, call30from subprocess import check_output, CalledProcessError, call
3131
32import autopilot._glib32import autopilot._glib
@@ -483,7 +483,10 @@
483 .. note:: This may change depending on the current locale.483 .. note:: This may change depending on the current locale.
484484
485 """485 """
486 return self._getProperty('_NET_WM_NAME')486 try:
487 return self._getProperty('_NET_WM_NAME')
488 except Xerror.BadWindow:
489 return self.name
487490
488 @property491 @property
489 def geometry(self):492 def geometry(self):

Subscribers

People subscribed via source and target branches