Commit ace2e6f9 authored by Stefan Behnel's avatar Stefan Behnel

encode code to bytes before hashing it

parent 4676eec2
...@@ -1542,7 +1542,7 @@ class CCodeWriter(object): ...@@ -1542,7 +1542,7 @@ class CCodeWriter(object):
include_dir = self.globalstate.common_utility_include_dir include_dir = self.globalstate.common_utility_include_dir
if include_dir and len(code) > 1024: if include_dir and len(code) > 1024:
include_file = "%s_%s.h" % ( include_file = "%s_%s.h" % (
name, hashlib.md5(code).hexdigest()) name, hashlib.md5(code.encode('utf8')).hexdigest())
path = os.path.join(include_dir, include_file) path = os.path.join(include_dir, include_file)
if not os.path.exists(path): if not os.path.exists(path):
tmp_path = '%s.tmp%s' % (path, os.getpid()) tmp_path = '%s.tmp%s' % (path, os.getpid())
......
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