← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:simplify-test-on-merge into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:simplify-test-on-merge into launchpad:master.

Commit message:
Simplify select loop in test_on_merge

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/414174

As of Python 3.5, `select()` automatically retries on `EINTR` (https://docs.python.org/3/whatsnew/3.5.html#pep-475-retry-system-calls-failing-with-eintr), so we no longer need to do this manually.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:simplify-test-on-merge into launchpad:master.
diff --git a/test_on_merge.py b/test_on_merge.py
index 19b5503..a86ad0e 100755
--- a/test_on_merge.py
+++ b/test_on_merge.py
@@ -170,25 +170,7 @@ def run_test_process():
     # Popen.communicate() with large data sets.
     open_readers = {xvfb_proc.stdout}
     while open_readers:
-        # select() blocks for a long time and can easily fail with EINTR
-        # <https://bugs.launchpad.net/launchpad/+bug/615740>.  Really we
-        # should have EINTR protection across the whole script (other syscalls
-        # might be interrupted) but this is the longest and most likely to
-        # hit, and doing it perfectly in python has proved to be quite hard in
-        # bzr. -- mbp 20100924
-        while True:
-            try:
-                rlist, wlist, xlist = select.select(
-                    open_readers, [], [], TIMEOUT)
-                break
-            except select.error as e:
-                # nb: select.error doesn't expose a named 'errno' attribute,
-                # at least in python 2.6.5; see
-                # <http://mail.python.org/pipermail/python-dev/2000-October/009671.html>
-                if e.args[0] == errno.EINTR:
-                    continue
-                else:
-                    raise
+        rlist, wlist, xlist = select.select(open_readers, [], [], TIMEOUT)
 
         if len(rlist) == 0:
             # The select() statement timed out!