diff options
| author | Barry Warsaw | 2016-04-30 13:34:04 -0400 |
|---|---|---|
| committer | GitLab | 2016-04-30 19:54:54 +0000 |
| commit | c6eb7ee3e574b48ee016dd31af2014b0ed083268 (patch) | |
| tree | 14c1f1e7bb382898ee50909333365aab335aa4a1 /src/mailman/bin | |
| parent | 465f24ff33e154385322ee894d32d8b7dd9b3941 (diff) | |
| download | mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.gz mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.zst mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.zip | |
Use contextlib.suppress() where appropriate.
Diffstat (limited to 'src/mailman/bin')
| -rw-r--r-- | src/mailman/bin/docs/master.rst | 9 |
1 files changed, 2 insertions, 7 deletions
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 |
