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




commit 8431fbcc9c0288d7775e53aef9ac3d2eb6d2b17b
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.

 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]