diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-21 17:50:23 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-21 17:50:23 +0100 |
commit | 9a89db5909a82513126f6b6d1eacb1d95b9bfed0 (patch) | |
tree | 48a3dad1a7919659735410216535bc586037c0b1 /indra/lib/python/uuid.py | |
parent | e66df6e89fa4bc92842f063478a4568798022f42 (diff) | |
parent | a36033853a7d567e92713a0392b29754521f338b (diff) |
merge
Diffstat (limited to 'indra/lib/python/uuid.py')
-rw-r--r-- | indra/lib/python/uuid.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/lib/python/uuid.py b/indra/lib/python/uuid.py index 48dac84377..0bc21a35f8 100644 --- a/indra/lib/python/uuid.py +++ b/indra/lib/python/uuid.py @@ -446,8 +446,14 @@ def uuid1(node=None, clock_seq=None): def uuid3(namespace, name): """Generate a UUID from the MD5 hash of a namespace UUID and a name.""" - import md5 - hash = md5.md5(namespace.bytes + name).digest() + try: + # Python 2.6 + from hashlib import md5 + except ImportError: + # Python 2.5 and earlier + from md5 import new as md5 + + hash = md5(namespace.bytes + name).digest() return UUID(bytes=hash[:16], version=3) def uuid4(): |