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/core/runner.py | |
| parent | 465f24ff33e154385322ee894d32d8b7dd9b3941 (diff) | |
| download | mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.gz mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.zst mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.zip | |
Diffstat (limited to 'src/mailman/core/runner.py')
| -rw-r--r-- | src/mailman/core/runner.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mailman/core/runner.py b/src/mailman/core/runner.py index 4c9c59464..d193a1082 100644 --- a/src/mailman/core/runner.py +++ b/src/mailman/core/runner.py @@ -22,6 +22,7 @@ import signal import logging import traceback +from contextlib import suppress from io import StringIO from lazr.config import as_boolean, as_timedelta from mailman import public @@ -112,7 +113,7 @@ class Runner: def run(self): """See `IRunner`.""" # Start the main loop for this runner. - try: + with suppress(KeyboardInterrupt): while True: # Once through the loop that processes all the files in the # queue directory. @@ -126,10 +127,7 @@ class Runner: # pass it the file count so it can decide whether to do more # work now or not. self._snooze(filecnt) - except KeyboardInterrupt: - pass - finally: - self._clean_up() + self._clean_up() def _one_iteration(self): """See `IRunner`.""" |
