From: Giacomo Travaglini Date: Tue, 5 May 2020 09:38:10 +0000 (+0100) Subject: python: Manually convert float to int when using %x X-Git-Tag: v20.0.0.0~55 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=38e7427ea7aec120ac8ffdf72918c549151f2e96;p=gem5.git python: Manually convert float to int when using %x This is required by python3.5 which is not allowing a floating point value to be printed in hex and will trigger a TypeError assertion: TypeError: %X format: an integer is required, not float Change-Id: I2033366751924579cc87e7fccda8fdb33a31412d Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28607 Reviewed-by: Bobby R. Bruce Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/python/m5/util/dot_writer.py b/src/python/m5/util/dot_writer.py index e6de3f321..c66108d21 100644 --- a/src/python/m5/util/dot_writer.py +++ b/src/python/m5/util/dot_writer.py @@ -267,7 +267,7 @@ def dot_gen_colour(simNode, isPort = False): return dot_rgb_to_html(r, g, b) def dot_rgb_to_html(r, g, b): - return "#%.2x%.2x%.2x" % (r, g, b) + return "#%.2x%.2x%.2x" % (int(r), int(g), int(b)) # We need to create all of the clock domains. We abuse the alpha channel to get # the correct domain colouring.