From 533a3ebdd070bf011b57fcc03a1f03ae3d12022b Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sat, 8 Aug 2020 16:10:16 +0200 Subject: [PATCH] Revert "python: Explicitly add the 'L' suffix on Python 3" 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 Reviewed-by: Alyssa Rosenzweig Reviewed-by: Dylan Baker Part-of: (cherry picked from commit 93cb3aca0347bf4a9ed31226627672b178841cfb) --- .pick_status.json | 2 +- src/compiler/nir/nir_algebraic.py | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f4f3e109d89..6eceec0d0e2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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" }, diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py index 37fefd87a6b..c5b47ff9282 100644 --- a/src/compiler/nir/nir_algebraic.py +++ b/src/compiler/nir/nir_algebraic.py @@ -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