1.1 --- a/optimiser.py Wed Dec 14 16:40:00 2016 +0100
1.2 +++ b/optimiser.py Wed Dec 14 17:22:07 2016 +0100
1.3 @@ -275,11 +275,11 @@
1.4 f = open(join(self.output, "constants"), "w")
1.5 try:
1.6 constants = []
1.7 - for (value, value_type), n in self.constants.items():
1.8 - constants.append((n, value_type, value))
1.9 + for (value, value_type, encoding), n in self.constants.items():
1.10 + constants.append((n, value_type, encoding, value))
1.11 constants.sort()
1.12 - for n, value_type, value in constants:
1.13 - print >>f, value_type, repr(value)
1.14 + for n, value_type, encoding, value in constants:
1.15 + print >>f, value_type, encoding or "{}", repr(value)
1.16
1.17 finally:
1.18 f.close()
1.19 @@ -648,7 +648,7 @@
1.20 for path, constants in self.importer.all_constants.items():
1.21
1.22 # Record constants and obtain a number for them.
1.23 - # Each constant is actually (value, value_type).
1.24 + # Each constant is actually (value, value_type, encoding).
1.25
1.26 for constant, n in constants.items():
1.27 add_counter_item(self.constants, constant)