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
=== modified file 'autopilot/display/_X11.py'
--- autopilot/display/_X11.py 2013-07-14 08:32:38 +0000
+++ autopilot/display/_X11.py 2013-07-19 04:38:28 +0000
@@ -21,6 +21,7 @@
21import logging21import logging
2222
23from autopilot.display import Display as DisplayBase23from autopilot.display import Display as DisplayBase
24from autopilot.utilities import Silence
2425
25logger = logging.getLogger(__name__)26logger = logging.getLogger(__name__)
2627
@@ -30,9 +31,10 @@
30 # Note: MUST import these here, rather than at the top of the file.31 # Note: MUST import these here, rather than at the top of the file.
31 # Why? Because sphinx imports these modules to build the API32 # Why? Because sphinx imports these modules to build the API
32 # documentation, which in turn tries to import Gdk, which in turn33 # documentation, which in turn tries to import Gdk, which in turn
33 # fails because there's no DISPlAY environment set in the package34 # fails because there's no DISPLAY environment set in the package
34 # builder.35 # builder.
35 from gi.repository import Gdk36 with Silence():
37 from gi.repository import Gdk
36 self._default_screen = Gdk.Screen.get_default()38 self._default_screen = Gdk.Screen.get_default()
37 if self._default_screen is None:39 if self._default_screen is None:
38 raise RuntimeError(40 raise RuntimeError(

Subscribers

People subscribed via source and target branches