This reverts commit
ad363913e6766280f53838126d67370f9e97aa12.
This code was added to be able to compare the output file while porting
the script from python2 to python3, but this has long been finished and
the extra complexity is not needed anymore.
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>
if isinstance(self.value, int):
return hex(self.value)
elif isinstance(self.value, float):
- i = struct.unpack('Q', struct.pack('d', self.value))[0]
- h = hex(i)
-
- # On Python 2 this 'L' suffix is automatically added, but not on Python 3
- # Adding it explicitly makes the generated file identical, regardless
- # of the Python version running this script.
- if h[-1] != 'L' and i > sys.maxsize:
- h += 'L'
-
- return h
+ return hex(struct.unpack('Q', struct.pack('d', self.value))[0])
else:
assert False