waf: git_submodule: fix uid() method for python3

Python3's hashlib.md5() requires Unicode-objects to be encoded before hashing.
This commit is contained in:
Gustavo Jose de Sousa 2016-02-19 16:11:46 +00:00 committed by Lucas De Marchi
parent 4aefe1caee
commit 898c2faaab
1 changed files with 4 additions and 2 deletions

View File

@ -57,8 +57,10 @@ class update_submodule(Task.Task):
def uid(self):
if not hasattr(self, 'uid_'):
m = Utils.md5()
m.update(self.__class__.__name__)
m.update(self.env.get_flat('SUBMODULE_PATH'))
def u(s):
m.update(s.encode('utf-8'))
u(self.__class__.__name__)
u(self.env.get_flat('SUBMODULE_PATH'))
self.uid_ = m.digest()
return self.uid_