Skip to content
Snippets Groups Projects
Commit 93cb3aca authored by Eric Engestrom's avatar Eric Engestrom :no_entry: Committed by Marge Bot
Browse files

Revert "python: Explicitly add the 'L' suffix on Python 3"


This reverts commit ad363913.

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's avatarEric Engestrom <eric@engestrom.ch>
Reviewed-by: default avatarAlyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: default avatarDylan Baker <dylan@pnwbakers.com>
Part-of: <mesa/mesa!3674>
parent f1eae2f8
No related branches found
No related tags found
No related merge requests found
......@@ -239,16 +239,7 @@ class Constant(Value):
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment