Merge lp:~veebers/autopilot/fix_1202609_silence_gdk_import_output into lp:autopilot

Proposed by Christopher Lee
Status: Merged
Approved by: Martin Pitt
Approved revision: 275
Merged at revision: 275
Proposed branch: lp:~veebers/autopilot/fix_1202609_silence_gdk_import_output
Merge into: lp:autopilot
Diff against target: 24 lines (+4/-2)
1 file modified
autopilot/display/_X11.py (+4/-2)
To merge this branch: bzr merge lp:~veebers/autopilot/fix_1202609_silence_gdk_import_output
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+175727@code.launchpad.net

Commit message

Silence non fatal error message from logs when attempting to import Gdk.

Description of the change

Silence non fatal error message from logs when attempting to import Gdk.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Martin Pitt (pitti) wrote :

Hah, I like "with Silence()", nice wrapper!

Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/display/_X11.py'
2--- autopilot/display/_X11.py 2013-07-14 08:32:38 +0000
3+++ autopilot/display/_X11.py 2013-07-19 04:38:28 +0000
4@@ -21,6 +21,7 @@
5 import logging
6
7 from autopilot.display import Display as DisplayBase
8+from autopilot.utilities import Silence
9
10 logger = logging.getLogger(__name__)
11
12@@ -30,9 +31,10 @@
13 # Note: MUST import these here, rather than at the top of the file.
14 # Why? Because sphinx imports these modules to build the API
15 # documentation, which in turn tries to import Gdk, which in turn
16- # fails because there's no DISPlAY environment set in the package
17+ # fails because there's no DISPLAY environment set in the package
18 # builder.
19- from gi.repository import Gdk
20+ with Silence():
21+ from gi.repository import Gdk
22 self._default_screen = Gdk.Screen.get_default()
23 if self._default_screen is None:
24 raise RuntimeError(

Subscribers

People subscribed via source and target branches