From c6eb7ee3e574b48ee016dd31af2014b0ed083268 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 30 Apr 2016 13:34:04 -0400 Subject: Use contextlib.suppress() where appropriate. --- src/mailman/bin/docs/master.rst | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/mailman/bin') diff --git a/src/mailman/bin/docs/master.rst b/src/mailman/bin/docs/master.rst index 5a3a94da6..c9bd60f13 100644 --- a/src/mailman/bin/docs/master.rst +++ b/src/mailman/bin/docs/master.rst @@ -41,13 +41,8 @@ runner processes. None of the children are running now. >>> import errno + >>> from contextlib import suppress >>> for pid in master.runner_pids: - ... try: + ... with suppress(ProcessLookupError): ... os.kill(pid, 0) ... print('Process did not exit:', pid) - ... except OSError as error: - ... if error.errno == errno.ESRCH: - ... # The child process exited. - ... pass - ... else: - ... raise -- cgit v1.2.3-70-g09d2