Commit ddaa6e5e authored by Bernhard M. Wiedemann's avatar Bernhard M. Wiedemann

Fix vmodtool with python3

Without this patch, it did
TypeError: Unicode-objects must be encoded before hashing

Fixes: #2436
parent d6b3076b
......@@ -859,7 +859,7 @@ class vcc(object):
def parse(self):
global inputline
a = "\n" + open(self.inputfile, "r").read()
self.file_id = hashlib.sha256(a).hexdigest()
self.file_id = hashlib.sha256(a.encode('utf-8')).hexdigest()
s = a.split("\n$")
self.copyright = s.pop(0).strip()
while s:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment