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/commands/tests | |
| parent | 465f24ff33e154385322ee894d32d8b7dd9b3941 (diff) | |
| download | mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.gz mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.zst mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.zip | |
Diffstat (limited to 'src/mailman/commands/tests')
| -rw-r--r-- | src/mailman/commands/tests/test_control.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/mailman/commands/tests/test_control.py b/src/mailman/commands/tests/test_control.py index 26d921cd7..7377c4666 100644 --- a/src/mailman/commands/tests/test_control.py +++ b/src/mailman/commands/tests/test_control.py @@ -56,22 +56,12 @@ def find_master(): until = timedelta(seconds=10) + datetime.now() while datetime.now() < until: time.sleep(0.1) - try: + with suppress(FileNotFoundError, ValueError, ProcessLookupError): with open(config.PID_FILE) as fp: pid = int(fp.read().strip()) os.kill(pid, 0) - except IOError as error: - if error.errno != errno.ENOENT: - raise - except ValueError: - pass - except OSError as error: - if error.errno != errno.ESRCH: - raise - else: - return pid - else: - return None + return pid + return None class FakeArgs: |
