[gnome-settings-daemon/benzea/ci-fixes: 3/19] tests: Use poll rather than select
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/benzea/ci-fixes: 3/19] tests: Use poll rather than select
- Date: Thu, 22 Jul 2021 12:27:12 +0000 (UTC)
commit e4e6f36196da4b9ac819599e83496320033515ea
Author: Benjamin Berg <bberg redhat com>
Date: Mon Jul 19 16:56:58 2021 +0200
tests: Use poll rather than select
Just because poll is the more modern API.
tests/output_checker.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/tests/output_checker.py b/tests/output_checker.py
index 7cb1060a..765da9ce 100644
--- a/tests/output_checker.py
+++ b/tests/output_checker.py
@@ -47,12 +47,14 @@ class OutputChecker(object):
self._thread.start()
def _copy(self):
+ p = select.poll()
+ p.register(self._pipe_fd_r)
while True:
try:
# Be lazy and wake up occasionally in case _pipe_fd_r became invalid
# The reason to do this is because os.read() will *not* return if the
# FD is forcefully closed.
- select.select([self._pipe_fd_r], [], [], 0.1)
+ p.poll(0.1)
r = os.read(self._pipe_fd_r, 1024)
if not r:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]