mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-04 12:50:25 +01:00
Revert "python: Explicitly add the 'L' suffix on Python 3"
This reverts commitad363913e6. 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> (cherry picked from commit93cb3aca03)
This commit is contained in:
parent
ca9ab792c6
commit
533a3ebdd0
2 changed files with 2 additions and 11 deletions
|
|
@ -472,7 +472,7 @@
|
|||
"description": "Revert \"python: Explicitly add the 'L' suffix on Python 3\"",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "ad363913e6766280f53838126d67370f9e97aa12"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -249,16 +249,7 @@ class Constant(Value):
|
|||
if isinstance(self.value, integer_types):
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue