Python3 requires encoding the input string. Compatible with (at least) Python2.7

This commit is contained in:
Reijo Keskitalo 2017-12-21 10:10:46 -08:00
parent 588e61dab6
commit c3971099b3

View file

@ -15,5 +15,5 @@ env = Environment(block_start_string='/*{',
extra_vars = dict(len=len)
input = sys.stdin.read()
sys.stdout.write('/* DO NOT EDIT. md5sum of source: %s */' % hashlib.md5(input).hexdigest())
sys.stdout.write('/* DO NOT EDIT. md5sum of source: %s */' % hashlib.md5(input.encode()).hexdigest())
sys.stdout.write(env.from_string(input).render(**extra_vars))