summaryrefslogtreecommitdiff
path: root/src/mailman/testing/helpers.py
diff options
context:
space:
mode:
authorBarry Warsaw2016-04-30 13:34:04 -0400
committerGitLab2016-04-30 19:54:54 +0000
commitc6eb7ee3e574b48ee016dd31af2014b0ed083268 (patch)
tree14c1f1e7bb382898ee50909333365aab335aa4a1 /src/mailman/testing/helpers.py
parent465f24ff33e154385322ee894d32d8b7dd9b3941 (diff)
downloadmailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.gz
mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.zst
mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.zip
Diffstat (limited to 'src/mailman/testing/helpers.py')
-rw-r--r--src/mailman/testing/helpers.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py
index 3edd66479..a87dd58ec 100644
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -31,7 +31,7 @@ import datetime
import threading
from base64 import b64encode
-from contextlib import contextmanager
+from contextlib import contextmanager, suppress
from email import message_from_string
from httplib2 import Http
from lazr.config import as_timedelta
@@ -183,14 +183,11 @@ class TestableMaster(Master):
starting_kids = set(self._kids)
while starting_kids:
for pid in self._kids:
- try:
+ # Ignore the exception which gets raised when the child has
+ # not yet started.
+ with suppress(ProcessLookupError):
os.kill(pid, 0)
starting_kids.remove(pid)
- except OSError as error:
- if error.errno == errno.ESRCH:
- # The child has not yet started.
- pass
- raise
# Keeping a copy of all the started child processes for use by the
# testing environment, even after all have exited.
self._started_kids = set(self._kids)