[gnome-settings-daemon/benzea/ci-fixes] tests: Fix OutputChecker trying to close FD -1




commit 25374412a610ab473a937562e34c48ea0992c60a
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Jul 22 14:57:30 2021 +0200

    tests: Fix OutputChecker trying to close FD -1
    
    This can happen if the watched process has terminated already.
    
    Reported-By: Bastien Nocera <hadess hadess net>

 tests/output_checker.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/tests/output_checker.py b/tests/output_checker.py
index 1680c2dc..265e3234 100644
--- a/tests/output_checker.py
+++ b/tests/output_checker.py
@@ -177,7 +177,8 @@ class OutputChecker(object):
 
         fd = self._pipe_fd_r
         self._pipe_fd_r = -1
-        os.close(fd)
+        if fd >= 0:
+            os.close(fd)
 
         self._thread.join()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]