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/utilities/uid.py | |
| parent | 465f24ff33e154385322ee894d32d8b7dd9b3941 (diff) | |
| download | mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.gz mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.zst mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.zip | |
Diffstat (limited to 'src/mailman/utilities/uid.py')
| -rw-r--r-- | src/mailman/utilities/uid.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mailman/utilities/uid.py b/src/mailman/utilities/uid.py index cef0ebc87..4389bcd92 100644 --- a/src/mailman/utilities/uid.py +++ b/src/mailman/utilities/uid.py @@ -27,6 +27,7 @@ import uuid import random import hashlib +from contextlib import suppress from flufl.lock import Lock from mailman import public from mailman.config import config @@ -125,11 +126,8 @@ class UIDFactory(_PredictableIDGenerator): """ while True: uid = uuid.uuid4() - try: + with suppress(ValueError): UID.record(uid) - except ValueError: - pass - else: return uid def _next_predictable_id(self): |
