compat: Add hashlib.md5()
[git-cola.git] / cola / compat.py
blob0fe00e3d89d1454c59356b48755b36d04a6fd047
1 try:
2 set = set
3 except NameError:
4 from sets import Set as set
5 set = set
7 try:
8 import hashlib
9 except ImportError:
10 import md5
11 class hashlib(object):
12 @staticmethod
13 def new(*args):
14 return md5.new()
16 @classmethod
17 def md5(cls, value=''):
18 obj = md5.new()
19 obj.update(value)
20 return obj