summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2018-05-03 19:56:28 +0200
committerBastien Nocera <hadess@hadess.net>2018-05-03 19:57:52 +0200
commit5edef272cc3b0ef850bf2d0b7cb6fd844a625615 (patch)
tree8442f62ecd02c5d9eef751f2c58157bb99232b52
parent3e9b7f8e11972d97133f0560aa110b9fca5d4633 (diff)
downloadgnome-settings-daemon-5edef272cc3b0ef850bf2d0b7cb6fd844a625615.tar.gz
power: Fix possible exception trying to read logind stdout
ERROR: test_inhibitor_idletime (__main__.PowerPluginTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/hadess/Projects/jhbuild/gnome-settings-daemon/plugins/power/test.py", line 966, in test_inhibitor_idletime self.check_no_suspend(2) File "/home/hadess/Projects/jhbuild/gnome-settings-daemon/plugins/power/test.py", line 335, in check_no_suspend log = self.logind.stdout.read() IOError: [Errno 11] Resource temporarily unavailable https://bugzilla.gnome.org/show_bug.cgi?id=794563
-rwxr-xr-xplugins/power/test.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/power/test.py b/plugins/power/test.py
index 6f1b49a3..eaa5341b 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -332,7 +332,11 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
# wait for specified time to ensure it didn't do anything
time.sleep(seconds)
# check that it did not suspend or hibernate
- log = self.logind.stdout.read()
+ try:
+ log = self.logind.stdout.read()
+ except IOError:
+ return
+
for m in methods:
needle = b' {} '.format(m)