diff options
| author | Barry Warsaw | 2016-01-13 12:20:40 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2016-01-13 12:20:40 -0500 |
| commit | 187dad97bf278b0ca9d080774072e8fb235154cc (patch) | |
| tree | 060b1575bb8dbe6e518ae359c22d812c9fa48b51 /src/mailman/core/api.py | |
| parent | 06159312d09192b1cede8d20b61ff856442426e8 (diff) | |
| download | mailman-187dad97bf278b0ca9d080774072e8fb235154cc.tar.gz mailman-187dad97bf278b0ca9d080774072e8fb235154cc.tar.zst mailman-187dad97bf278b0ca9d080774072e8fb235154cc.zip | |
Diffstat (limited to 'src/mailman/core/api.py')
| -rw-r--r-- | src/mailman/core/api.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mailman/core/api.py b/src/mailman/core/api.py index d23a9ec67..39c108db2 100644 --- a/src/mailman/core/api.py +++ b/src/mailman/core/api.py @@ -51,9 +51,11 @@ class API30: return uuid.int @staticmethod - def to_uuid(uuid_repr): + def to_uuid(uuid): """See `IAPI`.""" - return UUID(int=int(uuid_repr)) + if isinstance(uuid, UUID): + return uuid + return UUID(int=int(uuid)) @implementer(IAPI) @@ -77,6 +79,8 @@ class API31: return uuid.hex @staticmethod - def to_uuid(uuid_repr): + def to_uuid(uuid): """See `IAPI`.""" - return UUID(hex=uuid_repr) + if isinstance(uuid, UUID): + return uuid + return UUID(hex=uuid) |
